What operations can be done on std::atomic<T>
for other types?
21
• Assignment and copy (read and write) for all types
• Built-in and user-defined
• Increment and decrement for raw pointers
• Addition, subtraction, and bitwise logic operations for
integers (++, +=, –, -=, |=, &=, ^=)
• std::atomic<bool> is valid, no special operations
• std::atomic<double> is valid, no special operations
• No atomic increment for floating-point numbers!