Function RcPtr.compareExchangeWeak
Same as compareExchangeStrong
but may fail spuriously.
bool compareExchangeWeak(MemoryOrder success = MemoryOrder .seq, MemoryOrder failure = success, E, D, This)
(
scope ref E expected,
scope D desired
) scope
if (isRcPtr!E && !is(E == shared) && isRcPtr!D && !is(D == shared) && isMoveAssignable!(D, This) && isCopyAssignable!(This, E) && (This .isWeak == D .isWeak) && (This .isWeak == E .isWeak));
More info in c++ std::atomic<std::shared_ptr>
.