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.
Walter Bright via Digitalmars-d-announce Tue, 16 Aug 2016 13:36:05 -0700
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.