scope exit in mixin template

monarch_dodra via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 8 12:44:12 PDT 2014


On Sunday, 8 June 2014 at 18:28:25 UTC, Byron wrote:
> void c_free(bar* b) { b = null; }

Heads up: This code does nothing. You are passing the pointer by 
value, so "b = null;" will have no effect at the end of the call. 
Use pass by ref:

void c_free(ref bar* b) { b = null; }


More information about the Digitalmars-d-learn mailing list