Lecture 4 - Slide 26 : 40 |
It is possible to mark a member function as constant
A constant member function is not allowed to change the state of the object.
In addition, it makes sense to call a constant member function on a constant object
The programs on this slides motivate a solution on the following slide
The problem is that const member functions are not allowed to modify the caching variables.
In the next version - on the following page - we show how to deal with this problem