typeid Operator
// compile with: /GR /EHsc
#include <iostream>
#include <typeinfo.h>
template < typename T > T max( T arg1, T arg2 ) {
cout << typeid( T ).name() << "s compared." << endl;
return ( arg1 > arg2 ? arg1 : arg2 );
}
返回類型的名字