分类: C/C++
2009-04-29 16:14:07
C++ compilers disallow member function calls for const objects unless the member functions themselves are also declared const.
C++编译器对于const对象不允许调用它的成员函数,除非成员函数也被声明为const.
This is true even for get member functions that do not modify the object.
即使对不修改对象的get系列成员函数也是这样.
In addition, the compiler does not allow member functions declared const to modify the object.
另外,编译器不允许声明为const的函数修改对象.