Skip to content

Commit

Permalink
constant members cannot be updated
Browse files Browse the repository at this point in the history
  • Loading branch information
huihut committed Apr 13, 2021
1 parent e6dbc2b commit 191b305
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public:
void function()
{
// 对象
A b; // 普通对象,可以调用全部成员函数、更新常成员变量
A b; // 普通对象,可以调用全部成员函数
const A a; // 常对象,只能调用常成员函数
const A *p = &a; // 指针变量,指向常对象
const A &q = a; // 指向常对象的引用
Expand Down
2 changes: 1 addition & 1 deletion README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public:
void function()
{
// object
A b; // ordinary object, can call all member functions, update constant member variables
A b; // ordinary object, can call all member functions
const A a; // constant object, can only call constant member functions
const A *p = &a; // pointer variable, point to a constant object
const A &q = a; // reference to constant object
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public:
void function()
{
// 对象
A b; // 普通对象,可以调用全部成员函数、更新常成员变量
A b; // 普通对象,可以调用全部成员函数
const A a; // 常对象,只能调用常成员函数
const A *p = &a; // 指针变量,指向常对象
const A &q = a; // 指向常对象的引用
Expand Down

0 comments on commit 191b305

Please sign in to comment.