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 阅读(173) 评论(0)  编辑 收藏 引用

<2007年11月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

导航

统计

常用链接

留言簿(3)

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜