std::experimental::atomic_shared_ptr<T>::exchange

Atomically replaces the underlying shared_ptr with desired. The operation is a read-modify-write operation. Memory is affected according to the value of order.

# Declarations

shared_ptr<T> exchange( shared_ptr<T> desired, std::memory_order order = std::memory_order_seq_cst ) noexcept;

# Parameters

# Return value

The value of the atomic variable before the call.

# See also