Persistent list

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Sun Nov 15 06:21:15 PST 2015


> For instance, this code compiles and runs just fine.
>
>     void main()
>     {
>         auto i = new immutable int(5);
>         assert(*i == 5);
>         auto j = cast(int*)i;
>         *j = 42;
>         assert(*i == 42);
>     }

AFAIK this is UB already (in practice), you will get different 
results depending on compiler and optimization flags.


More information about the Digitalmars-d mailing list