#include "stdafx.h" #include <typeinfo> using namespace std; template<class T> class Cat { public: void eat() { printf("eat %s",typeid(T).name()); } }; class Fish { }; int _tmain(int argc, _TCHAR* argv[]) { Cat<Fish> cat; printf("%s ", typeid(cat).name()); // class Cat cat.eat();//eat class Fish getchar(); return 0; }