See example bellow, i want to pass object to function nullIt and want this function to null it.

----
import std.stdio;

static if (!is(typeof(writeln)))
        alias writefln writeln;


class MyClass{
        
}

void nullIt(ref Object o)
{
        o = null;
}

void main()
{
        auto o = new MyClass();
        
        nullIt(o);
        
        if (o is null)
                writeln("It is null");
}

Thanks in advance.

Reply via email to