On Monday, 20 August 2018 at 12:56:42 UTC, Kagamin wrote:
You need `return` attribute there, not `scope`:

struct MyStruct
{
    import core.stdc.stdlib;
    int* ints;
    this(int size) @trusted { ints = cast(int*) malloc(size); }
    ~this() @trusted { free(ints); }
    inout(int)* ptr() return inout { return ints; }
}

I need `return` for what exactly? Your code still compiles, and my point is it shouldn't. It sure isn't memory safe.

Reply via email to