#include <iostream>
#include <iomanip>
using namespace std;

static void print_addr(const char *type, const void *p){
	cout << right << setfill(' ');
	cout << setw(32) << type << ": ";
	cout << left << "I'm " << p << endl;
}

class with_ref{
public:
	void whoami(void) const{
		print_addr(__PRETTY_FUNCTION__, this);
	}
	void whoami(void){
		print_addr(__PRETTY_FUNCTION__, this);
		static_cast<const with_ref &>(*this).whoami();
	}
};

class without_ref{
public:
	void whoami(void) const{
		print_addr(__PRETTY_FUNCTION__, this);
	}
	void whoami(void){
		print_addr(__PRETTY_FUNCTION__, this);
		static_cast<const without_ref>(*this).whoami();
	}
};

int main() {
	with_ref with_ref_inst;
	with_ref_inst.whoami();
	
	without_ref without_ref_inst;
	without_ref_inst.whoami();
	return 0;
}