C++ - checking if a class has a certain method at compile time
- by jetwolf
Here's a question for the C++ gurus out there. Is there a way to check at compile time where a type has a certain method, and do one thing if it does, and another thing if it doesn't?
Basically, I have a template function
template <typename T>
void function(T t);
and I it to behave a certain way if T has a method g(), and another way if…