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(123); assert(cast(bool)x); //explicit cast assert(x); //implicit cast x = null; assert(!cast(bool)x); //explicit cast assert(!x); //implicit cast
Checks if this stores a non-null pointer, i.e. whether this != null.