On 8/16/2016 11:25 AM, Meta wrote:
What about this?

struct Rnd
{
    int* state;
}

void test()
{
    scope rnd = new Rnd();
    Rnd rnd2 = *rnd;

    saveGlobalState(rnd2);
}

'state' is set to null by 'new Rnd()', and so no pointers escape.

Reply via email to