Head Const

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 19 02:03:44 PST 2016


On 2/18/2016 11:46 PM, Jonathan M Davis wrote:
> We're in exactly the same boat as C++ in that we rely on the
> programmer to be smart about casting away const in order for const to provide
> any guarantees.

No, we're not. @trusted is specifically designed to be greppable (so are casts, 
by the way). This is quite unlike C++. I defy you (or anyone) to look at a piece 
of non-trivial C++ code and verify there are no deviated preversions going on.

D is simply not in the same boat at all.

We can debate about the holes in @safe that get bug reports filed on them, but 
these are bugs and we intent to fix all of them. There is no plan nor proposal 
to fix C++ unsafety.

 > I said that a type with an @mutable member would be forced to be marked with 
@mutable as well

You're proposing '@mutable const' ?


More information about the Digitalmars-d mailing list