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(0); assert(x != null); x = null; assert(x == null); } { IntrusivePtr!Foo x = IntrusivePtr!Foo.make(123); IntrusivePtr!Foo y = IntrusivePtr!Foo.make(123); assert(x == x); assert(y == y); assert(x != y); } { IntrusivePtr!Foo x; IntrusivePtr!(const Foo) y; assert(x == x); assert(y == y); assert(x == y); } { IntrusivePtr!Foo x = IntrusivePtr!Foo.make(123); IntrusivePtr!Foo y = IntrusivePtr!Foo.make(123); assert(x == x.element); assert(y.element == y); assert(x != y.element); }
Operator == and != . Compare pointers.