fork download
#include 
using namespace std;


template
struct RefValue
{
	typedef const T& Tp;
};

template<> struct RefValue{typedef int Tp;};

template
typename RefValue::Tp mymin(typename RefValue::Tp a, typename  RefValue::Tp b)
{
	return a < b ? a : b;
}

struct Obj{
   bool operator < (const Obj& other)const{return true;}
};

int main() {
	// your code goes here
	Obj o1; 
	Obj o2;
	int i10=10, i12=12;
	const int& z = mymin(i10,i12);
	std::cout << "i10: " << &i10 <<
	            " i12: " << &i12 << 
	            " min: " << &z << "\n";
	
	std::cout << mymin(i10, i12);
	
	const Obj& om = mymin(o1, o2);
	std::cout << "\nObj1:" << (void*) &o1 << " Obj2:" << (void*) &o2;
	std::cout << "\nObj:" << (void*) &om << "\n";
	
	return 0;
}
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
i10: 0xbfe44824 i12: 0xbfe44828 min: 0xbfe4482c
10
Obj1:0xbfe44822 Obj2:0xbfe44823
Obj:0xbfe44822