I have a template function which takes in objects. I need to determine whether the object is derived from a particular base class. If it is derived from the base class, I ne
A true template specialization would be even better :)
class A { public: char c; }; template void foo(const T & t) { std::cout << "this is generic."; } template <> void foo(const A & a) { std::cout << "this is specialized."; } int main(int argc, char * argv[]) { foo(A()); foo(int()); }