标签:
#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 \n", typeid(cat).name()); // class Cat cat.eat();//eat class Fish getchar(); return 0; }
标签:
原文地址:http://www.cnblogs.com/flashbird/p/4428991.html