IntrusivePtr.compareExchangeWeak

Same as compareExchangeStrong but may fail spuriously.

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

struct IntrusivePtr
scope
bool
compareExchangeWeak
(
MemoryOrder success = MemoryOrder.seq
MemoryOrder failure = success
E
D
this This
)
(
ref scope E expected
,
scope D desired
)
if (
!is(E == shared)
&&
&&
!is(D == shared)
&&
(
isMoveConstructable!(D, This) &&
isMutable!This
)
&&
(
isCopyConstructable!(This, E) &&
isMutable!E
)
&&
(This.isWeak == D.isWeak)
&&
(This.isWeak == E.isWeak)
)

Meta