Vision for the D language - stabilizing complexity?

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 12 05:05:53 PDT 2016


On 7/12/16 1:33 AM, Andrei Alexandrescu wrote:

> The solution (very ingenious, due to dicebot) in fact does not quite
> cast immutability away. Starting from a possibly immutable pointer, it
> subtracts an offset from it. At that point the memory is not tracked by
> the type system, but known to the allocator to contain metadata
> associated with the pointer that had been allocated with it. After the
> subtraction, the cast exposes the data which is mutable without
> violating the immutability of the object proper. As I said, it's quite
> an ingenious solution.

Ahem: https://forum.dlang.org/post/ft5a6g$1519$1@digitalmars.com

-Steve


More information about the Digitalmars-d mailing list