-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathtype_mentions.cpp
More file actions
78 lines (57 loc) · 991 Bytes
/
type_mentions.cpp
File metadata and controls
78 lines (57 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
class MyClass1 {};
typedef MyClass1 MyType1;
#define MYTYPE MyType1
int test1() {
MyClass1 a;
MyType1 b;
MYTYPE c;
return 0;
}
template<int n>
class MyClass2{
char array[n];
};
static MyClass2<sizeof(MyClass1)> MyVal2;
namespace my_namespace {
struct MyStruct1{
};
}
my_namespace
::
MyStruct1;
template<typename T1, typename T2>
class BinaryTemplate {
T1 first;
T2 second;
};
BinaryTemplate<MyClass1, my_namespace::MyStruct1> myBinaryTemplate;
class MyClass3 {
public:
typedef my_namespace::MyStruct1 MyTypedefStruct1;
};
static MyClass3::MyTypedefStruct1 myStruct1Value;
void (myFuncPtr)(MyClass3);
enum MyEnum {
myEnumVal
};
union MyUnion {
MyClass1 myVal1;
MyClass3 myVal3;
};
void test2() {
MyUnion un;
un.myVal1 = un.myVal1;
MyEnum en = myEnumVal;
MyType1 *t = new MyType1;
MyType1 *t100 = new MyType1[100];
en = (MyEnum)0;
}
template<class T>
void myTemplateFunction()
{
};
template<>
void myTemplateFunction<MyType1>()
{
};
MyType1 *ptr;