There are specializations of the atomic_ref class template
for the integral types
char,
signedchar,
unsignedchar,
short,
unsignedshort,
int,
unsignedint,
long,
unsignedlong,
longlong,
unsignedlonglong,
char8_t,
char16_t,
char32_t,
wchar_t,
and any other types needed by the typedefs in the header <cstdint>.
For each such type integral-type,
the specialization atomic_ref<integral-type> provides
additional atomic operations appropriate to integral types.
Effects: Atomically replaces the value referenced by *ptr with
the result of the computation applied to the value referenced by *ptr
and the given operand.
Memory is affected according to the value of order.
These operations are atomic read-modify-write operations ([intro.races]).
Remarks: Except for fetch_max and fetch_min, for signed integer types
the result is as if the object value and parameters
were converted to their corresponding unsigned types,
the computation performed on those types, and
the result converted back to the signed type.
For fetch_max and fetch_min, the maximum and minimum
computation is performed as if by max and min algorithms
([alg.min.max]), respectively, with the object value and the first
parameter as the arguments.