I have a class templated with typename T. It contains a function,
typename T
template myClass operator+(myClass
The compiler on overload resolution fails to find a right candidate for operator+ because T is already being deducted to double and literal 5 is an integer. Solution:
operator+
T
double
5
template myClass operator+(myClass lhs, const T2& rhs) { return lhs += T1(rhs); }