SharedPtr.opCast - multiple declarations

Function SharedPtr.opCast

Checks if this stores a non-null pointer, i.e. whether this != null.

bool opCast(To)() const pure nothrow @nogc scope @safe
if (is(To : bool));

Examples

SharedPtr!long x = SharedPtr!long.make(123);
assert(cast(bool)x);    //explicit cast
assert(x);              //implicit cast
x = null;
assert(!cast(bool)x);   //explicit cast
assert(!x);             //implicit cast

Function SharedPtr.opCast

Support for quelifier cast.

ref To opCast(To, This)() pure nothrow @nogc scope
if (is(immutable(To) : immutable(typeof(this))));