static struct Foo{ ControlBlock!(int, int) c; int i; this(int i)pure nothrow @safe @nogc{ this.i = i; } } { IntrusivePtr!Foo x = IntrusivePtr!Foo.make(1); assert(x.useCount == 1); x = null; assert(x.useCount == 0); assert(x == null); } { IntrusivePtr!(shared Foo) x = IntrusivePtr!(shared Foo).make(1); assert(x.useCount == 1); x = null; assert(x.useCount == 0); assert(x == null); } { shared IntrusivePtr!(shared Foo) x = IntrusivePtr!(shared Foo).make(1); assert(x.useCount == 1); x = null; assert(x.useCount == 0); assert(x.load == null); }
Releases the ownership of the managed object, if any.
After the call, this manages no object.