RcPtr.weakCount

Returns the number of different RcPtr.WeakType instances

Returns the number of different RcPtr.WeakType instances (this included) managing the current object or 0 if there is no managed object.

struct RcPtr
@property const scope nothrow @safe @nogc
weakCount
(
this This
)
()

Examples

RcPtr!long x = null;
assert(x.useCount == 0);
assert(x.weakCount == 0);

x = RcPtr!long.make(123);
assert(x.useCount == 1);
assert(x.weakCount == 0);

auto w = x.weak();
assert(x.useCount == 1);
assert(x.weakCount == 1);

Meta