ES.50: Don’t cast away const
Reason
It makes a lie out of const. Note
Usually the reason to “cast away const” is to allow the updating of some transient information of an otherwise immutable object. Examples are caching, memoization, and precomputation. Such examples are often handled as well or better using mutable or an indirection than with a const_cast.
Shouldn't only thread safe class members marked as mutable?
You Don’t Know const and mutable @hsutter
Shouldn't only thread safe class members marked as mutable?
You Don’t Know const and mutable @hsutter