T exchange( T desired, std::memory_order order = (since
C++20)
std::memory_order_seq_cst ) const noexcept;
Atomically replaces the value of the referenced object with desired. The
operation
is a read-modify-write operation. Memory is affected according to the value
of
order.