[ create a new paste ] login | about

Link: http://codepad.org/icXBM4uz    [ raw code | output | fork ]

C++, pasted on Aug 6:
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;
}


Output:
1
2
3
In function 'int main()':
Line 22: error: ambiguous overload for 'operator*' in 'b * c'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: