cptr::atomic_ptr::exchange

Replaces the pointer with p and returns the previous one, in one atomic step.

Synopsis

Declared in <cptr/pack.hpp>

T*
exchange(
    T* p,
    std::memory_order order = std::memory_order_seq_cst) noexcept;