cpp/atomic/atomic/operator arith

Atomically increments or decrements the current value. The operation is read-modify-write operation.

@1@ Performs atomic pre-increment. Equivalent to. @2@ Performs atomic post-increment. Equivalent to. @3@ Performs atomic pre-decrement. Equivalent to @4@ Performs atomic post-decrement. Equivalent to.

For signed types, arithmetic is defined to use two’s complement representation. There are no undefined results.

For types, the result may be an undefined address, but the operations otherwise have no undefined behavior. The program is ill-formed if is not an object type.

Parameters
(none)

Return value
@1,3@ The value of the atomic variable after the modification. Formally, the result of incrementing/decrementing the value immediately preceding the effects of this function in the modification order of. @2,4@ The value of the atomic variable before the modification. Formally, the value immediately preceding the effects of this function in the modification order of.