Persistent list

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sat Nov 14 15:20:08 PST 2015


On 11/14/15 5:49 PM, Timon Gehr wrote:
> It's supposed to guarantee that the given reference is not used to
> transitively mutate the object. The casts violate this.

I think that semantics needs to change. Specifically, either we add a 
@mutable attribute (which means const doesn't apply to fields marked as 
such and immutable objects cannot be created); or we could just decree 
that if a const object originates in a mutable object, casts should be 
well-defined. -- Andrei



More information about the Digitalmars-d mailing list