RcPtr.compareExchangeWeak

Same as compareExchangeStrong but may fail spuriously.

More info in c++ std::atomic<std::shared_ptr>.

struct RcPtr
scope
bool
compareExchangeWeak
(
MemoryOrder success = MemoryOrder.seq
MemoryOrder failure = success
E
D
this This
)
(
ref scope E expected
,
scope D desired
)
if (
isRcPtr!E &&
!is(E == shared)
&&
&&
!is(D == shared)
&&
isMoveAssignable!(D, This)
&&
isCopyAssignable!(This, E)
&&
(This.isWeak == D.isWeak)
&&
(This.isWeak == E.isWeak)
)

Meta