1 #include <iostream>
2 using namespace std;
3
4 class Person {
5 public:
6 Person()
7 {
8 ¦
9 ¦
10
11 ¦ this->m_A = 0;
12 ¦ this->m_B = 0;
13 }
14
15 void showInfo() const
16 {
17 ¦ this->m_B = 1000;
18 ¦ cout << "m_A=" << this->m_A << endl;
19 ¦ cout << "m_B=" << this->m_B << endl;
20 }
21
22 void show()
23 {
24 }
25
26 int m_A;
27 mutable int m_B;
28 };
29
30 void test01()
31 {
32 Person p1;
33 p1.showInfo();
34
35 const Person p2;
36 cout << p2.m_A << endl;
37 p2.showInfo();
38
39 }
40
41 int main()
42 {
43 test01();
44 return 0;
45 }