I need to overload basic operators to work with primitive types:
Frac
- Common fraction class; Frac(a,b) = a/b
. This is overload of operator >
template<typename t>
bool Frac::operator > (const t &right) {
if((long double)right)
return ((long double)right < this->toLongDouble());
else
cout << "Error!";
}
in main:
cout << ((Frac(1,2) > 2.5));
I have error:
Error: undefined reference to `bool Frac::operator><double>(double const&)'