Atomically store a new value and read the old one.
weak_ptr<T> exchange( weak_ptr<T> new_value, memory_order order = memory_order_seq_cst) noexcept;
Atomically store new_value
in *this
and retrieve the existing value of *this
.
The value of *this
immediately prior to the store.
Nothing.
This is an atomic read-modify-write operation for the memory location
comprising *this
.
#include <experimental/atomic>
std::experimental::atomic_weak_ptr
class template
std::experimental::atomic_weak_ptr
members
std::memory_order
enumeration