cpp/atomic/atomic/operator arith2

Atomically replaces the current value with the result of computation involving the previous value and. The operation is read-modify-write operation.

@1@ Performs atomic addition. Equivalent to + arg. @2@ Performs atomic subtraction. Equivalent to - arg. @3@ Performs atomic bitwise and. Equivalent to & arg. @4@ Performs atomic bitwise or. Equivalent to | arg. @5@ Performs atomic bitwise exclusive or. Equivalent to ^ arg.

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.

Return value
The resulting value (that is, the result of applying the corresponding binary operator to the value immediately preceding the effects of the corresponding member function in the modification order of ).