There are specializations of the atomic
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, the specialization
atomic<integral> provides additional atomic operations appropriate to integral types.
T fetch_key(T operand, memory_order order = memory_order::seq_cst)volatilenoexcept;
T fetch_key(T operand, memory_order order = memory_order::seq_cst)noexcept;
Effects: Atomically replaces the value pointed to by
this with the result of the computation applied to the
value pointed to by this and the given operand.
Memory is affected according to the value of order.
Remarks: 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.