Head Const

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 17 03:54:59 PST 2016


On 02/16/2016 09:51 PM, Walter Bright wrote:
> On 2/16/2016 11:29 AM, Marc Schütz wrote:
>> For example, it's always possible to use a global mutable associative
>> array to
>> store additional data connected with an immutable or const object
>> (ignoring
>> purity issues for the moment). That's safe because from the outside,
>> there's no
>> observable change to the state of the object itself, and the global
>> AA's type
>> (shared/thread-local) prevents race conditions.
>
> The trouble with that is you're relying on the programmer to ensure
> correctness. It'll revert D to C++ "trust the programmer" semantics.

That doesn't seem the case to me. -- Andrei



More information about the Digitalmars-d mailing list