Casting away const and invariant

Janice Caron caron800 at googlemail.com
Sun Sep 9 07:07:08 PDT 2007


Actually, forget the specific example. What I'm getting at is that,
right now, it's possible to cast away const /accidentally/.

My change would ensure that that was no longer the case.

And you miss one of the major points about C++'s const_cast<>. Yes, we
all agree that it's a BAD THING to do. But the point about C++'s
const_cast<> is not that it will make constness go away, it's that
static_cast<> /won't/.



More information about the Digitalmars-d mailing list