Atomically load a value and replace it with that value minus the
supplied value i,
using standard pointer arithmetic rules, and return the old value.
T* fetch_sub( ptrdiff_t i, memory_order order = memory_order_seq_cst) volatile;
- Effects:
Atomically retrieves the existing value of
*thisand stores old-value- iin*this.- Returns:
The value of
*thisimmediately prior to the store.- Throws:
Nothing.
- Note:
This is an atomic read-modify-write operation for the memory location comprising
*this.
#include <atomic>