1 #include <iostream>
2 using namespace std;
3
4 template<
class T>
5 class myclass
6 {
7 public:
8 T t;
9 void show(T tx)
10 {
11 cout << tx <<
endl;
12 }
13 };
14
15 void main()
16 {
17 /*int num;*/
18
19 /*__if_exists(num)
20 {
21 cout << "存在" << endl;
22 }*/
23 /*__if_not_exists(num)
24 {
25 cout << "不存在" << endl;
26 }*/
27
28 myclass<
int>
t1;
29
30 //检测某个模板有没有根据某个类型实例化
31 __if_exists(myclass<
int>
)
32 {
33 cout <<
"存在" <<
endl;
34 }
35 cin.
get();
36 }
转载于:https://www.cnblogs.com/xiaochi/p/8552369.html
相关资源:DirectX修复工具V4.0增强版
转载请注明原文地址: https://win8.8miu.com/read-27255.html