52.模板的重载

 1 #include <iostream>
 2 using namespace std;
 3 
 4 template<class T>
 5 void go(T t1)
 6 {
 7     cout << "ttttt" << endl;
 8 }
 9 
10 template<class T>
11 void go(T *t1)
12 {
13     cout << "******" << endl;
14 }
15 
16 void main()
17 {
18     int *p = new int[2]{ 1,2 };
19     go(p[0]);
20     go(p);
21     go(&p);
22     cin.get();
23 }

 

posted @ 2018-03-12 23:28  喵小喵~  阅读(84)  评论(0编辑  收藏  举报