1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
template<typename T> class CImg { int problem(const T val) { return (int)val; } }; class A{ public: operator int() const{ return 0; } }; A operator*(float a, const A &b) { return A(); } int main() { CImg<A> a; A b,c; A d = b*c; return 0; }
1 2 3
In function 'int main()': Line 22: error: ambiguous overload for 'operator*' in 'b * c' compilation terminated due to -Wfatal-errors.