Quite a few classes don't have
const
members (initialised only as an object is constructed) either. Quite a few classes have operations that change data members, so an object's state can evolve over time. Having some members (whether
const
or not) that are accessed by a member function call (e.g.
some_circle.circumference()
) and some members that are accessed directly (e.g.
some_circle.radius
) tends to catch out programmers - little mistakes of using one when only the other is supported, and such mistakes add up in terms of lost time or productivity. —
Peter 58 secs ago