摘要: 1 #include 2 #include 3 4 template 5 class A{ 6 T1 i; 7 T2 j; 8 public: 9 A(T1 t1,T2 t2){i=t1;j=t2;}10 bool comp(){return i>j;}11 void print_Type();12 };13 template 14 void A::print_Type()15 {16 printf("i的类型是%s\n",typeid(i).name());17 printf... 阅读全文
posted @ 2013-09-28 16:45 退之 阅读(221) 评论(0) 推荐(0) 编辑
摘要: templateT max(T a,T b){ return a>b?a:b;} 阅读全文
posted @ 2013-09-28 15:33 退之 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 void print(int x) 5 { 6 cout());18 for_each(iArray,iArray+len,print);19 cout<<endl;20 return 0;21 }View Code 阅读全文
posted @ 2013-09-28 15:31 退之 阅读(143) 评论(0) 推荐(0) 编辑