1 #include <iostream>
2 using namespace std;
3
4 class MyInteger {
5 public:
6 MyInteger()
7 {
8 ¦ m_A = 0;
9 }
10 int m_A;
11 };
12
13
14 MyInteger& operator++(MyInteger& p)
15 {
16 p.m_A++;
17 return p;
18 }
19
20
21 MyInteger operator++(MyInteger& p, int)
22 {
23 MyInteger tmp=p;
24 p.m_A++;
25 return tmp;
26 }
27
28 ostream& operator<<(ostream& cout, MyInteger& m)
29 {
30 cout << m.m_A;
31 return cout;
32 }
33
34 void test01()
35 {
36 MyInteger myint;
37
38 cout << ++myint << endl;
39
40 myint++;
41 cout << myint << endl;
42 }
43 int main()
44 {
45 test01();
46 return 0;
47 }