June 2018
Intermediate to advanced
348 pages
8h 45m
English
Similar to std::atomic<bool>, standard atomic integral types can be neither copy-constructible nor copy-assignable. However, they can be constructed and assigned from the corresponding non-atomic standard variant. Apart from the mandatory is_lock_free() member function, the standard atomic integral types, such as std::atomic<int> or std::atomic<unsigned long long>, also have load(), store(), exchange(), compare_exchange_weak(), and compare_exchange_strong() member functions, with similar semantics to those of std::atomic<bool>.
The integral variants of atomic types do support mathematical operations such as fetch_add(), fetch_sub(), fetch_and(), fetch_or() and fetch_xor(), compound-assignment operators (+=