Unexpected behavior when casting away immutable

bachmeier via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 23 07:34:06 PDT 2015


On Wednesday, 23 September 2015 at 05:24:05 UTC, John Colvin 
wrote:

> violating immutable is undefined behaviour, so the compiler is 
> technically speaking free to assume it never happens. At the 
> very least, neither snippet's result is guaranteed to show a 
> change or not. At the most, literally anything can happen.

I was not aware that you could "violate" immutable. In that case, 
it's not immutable.


More information about the Digitalmars-d-learn mailing list