Synopsis: | A member function that should not change the state of the object shall be declared const |
Language: | C++ |
Severity Level: | 5 |
Category: | Class Interface |
Description: |
It is possible that a const method requires non-const access to some of the data members, without changing the objects state. For example, when a lock variable (i.e. critical section) is used to synchronize access to other data members. In this case, the lock variable should be made mutable. See also [CON#005]. |