On Tuesday, 31 January 2017 at 01:30:48 UTC, Walter Bright wrote:
3. Nothing s2 transitively points to is altered via s2.

Wait, really? Does that mean that this code is implicitly illegal?

import core.stdc.string;

    void main()
    {
        int*[10] data1;
        int*[10] data2;

        memcpy(data1.ptr, data2.ptr, 10);
    }

Since memcpy is @system, I have no way to know for sure (the compiler obviously won't warn me since I can't mark main as @safe), so I'd argue the prototype doesn't carry that information.

Reply via email to