scope exit in mixin template

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


On Sun, 08 Jun 2014 19:44:12 +0000, monarch_dodra wrote:

> 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; }

yeah it was sample code, this idea was make and free were c library 
functions


More information about the Digitalmars-d-learn mailing list