SharedPtr.opCastImpl

Cast this to different type To when isSharedPtr!To.

BUG: qualfied variable of struct with dtor cannot be inside other struct (generated dtor will use opCast to mutable before dtor call ). opCast is renamed to opCastImpl

struct SharedPtr
scope
To
opCastImpl
(
To
this This
)
()
if (
!is(This == shared)
)

Examples

SharedPtr!long x = SharedPtr!long.make(123);
auto y = cast(SharedPtr!(const long))x;
auto z = cast(const SharedPtr!long)x;
auto u = cast(const SharedPtr!(const long))x;
assert(x.useCount == 4);

Meta