On Tuesday, 26 September 2017 at 17:27:02 UTC, Steven Schveighoffer wrote:

-Steve


About Variant - I was considering a pull request for retrieving a pointer to the internal data, but figured that it was left out on purpose due to @safety.

OTOH, I was looking through dmd commits, and it seems like there has been significant progress on 'scope'.

So I was thinking this:

struct Variant {

    scope inout(ubyte)[] data() inout
    {
        auto sz = type.tsize;
        assert(sz <= size);
        return store[0..sz];
    }
}

Thoughts?

Reply via email to