The code should not compile, but is there a way to tell if T is an "int" type in foo()?
Code:template <typename T> class A{ public: void foo(); }; template <typename T> void foo<T>() { if (T=="int") cout<<"int"<<endl; } int main(int argc, char* argv[]){ A<int> a; a.foo(); return 0; }