Weird rule for immutable

Timon Gehr timon.gehr at gmx.ch
Sun Apr 12 02:28:00 UTC 2020


On 12.04.20 04:26, Timon Gehr wrote:
> On 11.04.20 03:19, Victor Porton wrote:
>> ...
>>
>> int x = 1;
>> f(cast(*immutable(int*)&x);

Typos, I meant to write `f(*cast(immutable(int)*)&x)`.

>> x = 2; // the immutable reference does not exist at this point
>>         // but the assignment is disallowed(?)
> 


More information about the Digitalmars-d mailing list