T operator++(); T operator++() volatile; | (1) | (member only of atomic<Integral> template specialization)(since C++11) |
T* operator++(); T* operator++() volatile; | (1) | (member only of atomic<T*> template specialization)(since C++11) |
T operator++( int ); T operator++( int ) volatile; | (2) | (member only of atomic<Integral> template specialization)(since C++11) |
T* operator++( int ); T* operator++( int ) volatile; | (2) | (member only of atomic<T*> template specialization)(since C++11) |
T operator--(); T operator--() volatile; | (3) | (member only of atomic<Integral> template specialization)(since C++11) |
T* operator--(); T* operator--() volatile; | (3) | (member only of atomic<T*> template specialization)(since C++11) |
T operator--( int ); T operator--( int ) volatile; | (4) | (member only of atomic<Integral> template specialization)(since C++11) |
T* operator--( int ); T* operator--( int ) volatile; | (4) | (member only of atomic<T*> template specialization)(since C++11) |
Atomically increments or decrements the current value. The operation is read-modify-write operation.
fetch_add(1)+1
.fetch_add(1)
.fetch_sub(1)-1
fetch_sub(1)
.For signed Integral
types, arithmetic is defined to use two’s complement representation. There are no undefined results. For T*
types, the result may be an undefined address, but the operations otherwise have no undefined behavior.
(none).
*this
.*this
.noexcept
specification: noexcept
Unlike most pre-increment and pre-decrement operators, the pre-increment and pre-decrement operators for atomic types do not return a reference to the modified object. They return a copy of the stored value instead.
atomically adds the argument to the value stored in the atomic object and obtains the value held previously (public member function) |
|
atomically subtracts the argument from the value stored in the atomic object and obtains the value held previously (public member function) |
|
adds, subtracts, or performs bitwise AND, OR, XOR with the atomic value (public member function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/atomic/atomic/operator_arith