[Dlang-internal] DIP1000 discussion and testing

Walter Bright via Dlang-internal dlang-internal at puremagic.com
Sat Oct 22 01:10:51 PDT 2016


On 10/21/2016 8:38 AM, Dicebot wrote:
> It won't allow to fix `Unique`

What it does mean is given a unique pointer u,

    int foo(scope Unique u);

it is guaranteed that u's value does not escape from foo(). So,

    Unique u = malloc();
    foo(u);
    free(u); // guaranteed to not leave a dangling pointer


More information about the Dlang-internal mailing list