What guarantees does D 'const' provide, compared to C++?
Jonathan M Davis
jmdavisProg at gmx.com
Thu Aug 16 17:40:33 PDT 2012
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
More information about the Digitalmars-d
mailing list