Function IntrusivePtr.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 (isIntrusivePtr!E && !is(E == shared) && isIntrusivePtr!D && !is(D == shared) && (isMoveConstructable!(D, This) && isMutable!This) && (isCopyConstructable!(This, E) && isMutable!E) && (This.isWeak == D.isWeak) && (This.isWeak == E.isWeak));

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