Inherent code performance advantages of D over C?

Marco Leise Marco.Leise at gmx.de
Mon Dec 16 05:06:36 PST 2013


Am Sun, 15 Dec 2013 16:53:21 -0800
schrieb Walter Bright <newshound2 at digitalmars.com>:

> On 12/15/2013 4:22 PM, jerro wrote:
> >> You, as the guy who wrote the code, will (or should) know that there are no
> >> other live references, hence you are telling the compiler "trust me, I know
> >> there aren't any".
> >
> > So, is the intended meaning the following: If there exist any immutable
> > references to the data, mutating it results in undefined behavior? If so, I
> > think the documentation on creating immutable data should explicitly say so.
> 
> 
> Good idea. I suggest writing a pull request against the documentation for this.

+1. I kept telling people that casting immutable to mutable
and vice-versa is undefined behavior, based on that page.

-- 
Marco



More information about the Digitalmars-d mailing list