Answer
A const member function (declared with const after the parameter list) promises not to modify the object's observable state and can be called on const objects. Inside it, member variables are treated as const (unless marked mutable). Marking read-only methods const is core to const-correctness and lets them be used on const instances.
struct Box {
int size() const { return n; } // doesn't modify *this
int n = 0;
};Real-world example A getter is marked const so it can be called on a const Box passed to a function.