Atomically load a value and replace it with the sum of that value
and the supplied value i
using standard pointer arithmetic rules, and return the old value.
T* fetch_add( ptrdiff_t i, memory_order order = memory_order_seq_cst) volatile;
Atomically retrieves the existing value of *this
and stores old-value
+ i
in *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 <atomic>