How can you check whether a templated class has a member function?
Yes, with SFINAE you can check if a given class does provide a certain method. Here’s the working code: #include <iostream> struct Hello { int helloworld() { return 0; } }; struct Generic {}; // SFINAE test template <typename T> class has_helloworld { typedef char one; struct two { char x[2]; }; template <typename C> … Read more