This source file includes following definitions.
- pt_func1
- pm_func
- pm_func
- pm_func
- pm_func
- pm_meth
- pm_meth
- pm_meth
- pm_meth
- doSomething
- doSomething
- doSomething
- doSomethingElse
- doSomethingElse
- doSomethingCompletelyDifferent
- doSomething
- doSomethingElse
- doSomething
- doSomethingElse
- doSomething
- doSomethingElse
- doNothing
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #include <cmath>
24
25
26 namespace proto {
27
28 int pt_func1(int arg1);
29 int pt_func1(int arg1) {
30 return 0;
31 }
32
33 }
34
35
36 namespace fcn_poly {
37
38 int pm_func(void) {
39 return 0;
40 }
41 int pm_func(int a) {
42 return a;
43 }
44 int pm_func(char a) {
45 return int(a);
46 }
47 int pm_func(double a) {
48 return int(floor(a));
49 }
50
51 }
52
53
54 class meth_poly {
55 public:
56 int pm_meth(void) {
57 return 0;
58 }
59 int pm_meth(int a) {
60 return a;
61 }
62 int pm_meth(char a) {
63 return int(a);
64 }
65 int pm_meth(double a) {
66 return int(floor(a));
67 }
68
69 };
70
71
72 namespace template_partial_spec {
73 template <typename T> class test
74 {
75 public:
76 void doSomething(T t) { };
77 };
78
79 template <typename T> class test<T *>
80 {
81 public:
82 void doSomething(T* t) { };
83 };
84 }
85
86
87
88 namespace template_full_spec {
89 template <typename T> class test
90 {
91 public:
92 void doSomething(T t) { };
93 void doSomethingElse(T t) { };
94 };
95
96 template <> class test<int>
97 {
98 public:
99 void doSomethingElse(int t) { };
100 void doSomethingCompletelyDifferent(int t) { };
101 };
102 }
103
104
105 namespace template_multiple_spec {
106 template <typename T1, typename T2> class test
107 {
108 public:
109 void doSomething(T1 t) { };
110 void doSomethingElse(T2 t) { };
111 };
112
113 template <typename T2> class test<int, T2>
114 {
115 public:
116 void doSomething(int t) { };
117 void doSomethingElse(T2 t) { };
118 };
119
120 template <> class test<float, int>
121 {
122 public:
123 void doSomething(float t) { };
124 void doSomethingElse(int t) { };
125 void doNothing(void) { };
126 };
127 }
128
129
130