乱七八糟的片段

2014-11-24 11:56:11 · 作者: · 浏览: 1

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!" < 11 }
12 };
13
14 template class Helper
15 {
16 public:
17 T *t;
18
19 public:
20 T *operator -> ()
21 {
22 cout<<"your world!" < 23 return t;
24 }
25 };
26
27 int main(int argc, char *argv[])
28 {
29 Helper tt;
30 tt->QueryInterface(10);
31
32 return 0;

33 }
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<(3, 7) < 23 cout< 24 cout<(3.0, 7.0) < 25
26 return 0;
27 }

作者:芸渝