I want to be able to return the greater of two values, whether it it an integer, double, or class. I have overloaded the comparison operator for the class I want to use. The function is giving me linker errors in the main. Here is the code:
template <typename tType>
void returnGreater(tType &A, tType &B)
{
if(A > B)
{
cout << "A is greater"; //testing
return A;
}
else
{
cout << "B is greater"; //testing
return B;
}
}