On this page
std::atomic_ref<T>::exchange
|
(since C++20) |
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
.
Parameters
desired | - | value to assign |
order | - | memory order constraints to enforce |
Return value
The value of the referenced object before the call.
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/atomic/atomic_ref/exchange