01 #include
02
03 using namespace std;
04
05 class Unkown
06 {
07 public:
08 void QueryInterface(int a)
09 {
10 cout<<"Hello, this your world!" <
12 };
13
14 template
15 {
16 public:
17 T *t;
18
19 public:
20 T *operator -> ()
21 {
22 cout<<"your world!" <
24 }
25 };
26
27 int main(int argc, char *argv[])
28 {
29 Helper
30 tt->QueryInterface(10);
31
32 return 0;
1
view source
print
01 //函数模板
02 #include
03
04 using namespace std;
05
06 template
07
08 inline const T &Maximnum(const T &x, const T &y)
09 {
10 if (y > x)
11 {
12 return y;
13 }
14 else
15 {
16 return x;
17 }
18 }
19
20 int main(int argc, char *argv[])
21 {
22 cout<
26 return 0;
27 }
作者:芸渝