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.

Reply via email to