2012/8/17 Jonathan M Davis <[email protected]> > > On Friday, August 17, 2012 02:32:01 Mehrdad wrote: > > > C++ makes no such guarantees, because you're free to cast away > > > const and modifiy objects > > > > Not correct, as far as I understand. > > C++ only lets you cast away _const references_ to _mutable_ > > objects. > > If the object happens to have been const _itself_, then that's > > undefined behavior. > > Well, then our understandings on the matter conflict, and I don't know for > certain which of us is correct. > > - Jonathan M Davis
The C++ standard, section 7.1.6.1: Except that any class member declared mutable (7.1.1) can be modified, any attempt to modify a const object during its lifetime (3.8) results in undefined behavior. Torarin
