RcPtr.opCastImpl

Cast this to different type To when isRcPtr!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 RcPtr
scope
To
opCastImpl
(
To
this This
)
()
if (
isRcPtr!To &&
!is(This == shared)
)

Examples

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

Meta