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 );
}

返回类型的名字

posted on 2008-02-15 10:27 Randy 阅读(175) 评论(0)  编辑 收藏 引用

<2025年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

导航

统计

常用链接

留言簿(3)

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜