6 Dec
2009
6 Dec
'09
6:11 a.m.
Is there a way to use enable_if so that one specialization gets selected if
operator+ exists between two types, and another specialization if operator+
does not exist? For example:
template
::type* dummy = 0> void operator()(const A& a, const B& b) { std::cout << "a + b = " << (a + b) << std::endl; }
template
::type* dummy = 0> void operator()(const A& a, const B& b) { }
How would I implement the operator_plus_exists class?