To be const or not?
The Incredible Const Reference That Isn’t Const
by Jonathan Boccara
From the article:
While working on the NamedType library I came across a situation that left me stunned in bewilderment: a const reference that allows modification of the object it refers to. Without a const_cast. Without a mutable. Without anything up the sleeve.
How can this be? And how to enforce the const in that const reference?
Add a Comment
Comments are closed.