This header was originally in the C standard library (<stdatomic.h>).
This header is part of theconcurrency support library.
It is unspecified whether<stdatomic.h>
provides any declarations in namespacestd.
Macros | ||
(C++23) | compatibility macro such that_Atomic(T) is identical tostd::atomic<T> (function macro)[edit] | |
(C++11) | initializes anstd::atomic_flag tofalse (macro constant)[edit] | |
Types | ||
(C++11) | the lock-free boolean atomic type (class)[edit] | |
(C++11) | defines memory ordering constraints for the given atomic operation (enum)[edit] | |
(C++11) | std::atomic<bool> (typedef)[edit] | |
(C++11) | std::atomic<char> (typedef)[edit] | |
(C++11) | std::atomic<signedchar> (typedef)[edit] | |
(C++11) | std::atomic<unsignedchar> (typedef)[edit] | |
(C++11) | std::atomic<short> (typedef)[edit] | |
(C++11) | std::atomic<unsignedshort> (typedef)[edit] | |
(C++11) | std::atomic<int> (typedef)[edit] | |
(C++11) | std::atomic<unsignedint> (typedef)[edit] | |
(C++11) | std::atomic<long> (typedef)[edit] | |
(C++11) | std::atomic<unsignedlong> (typedef)[edit] | |
(C++11) | std::atomic<longlong> (typedef)[edit] | |
(C++11) | std::atomic<unsignedlonglong> (typedef)[edit] | |
(C++20) | std::atomic<char8_t> (typedef)[edit] | |
(C++11) | std::atomic<char16_t> (typedef)[edit] | |
(C++11) | std::atomic<char32_t> (typedef)[edit] | |
(C++11) | std::atomic<wchar_t> (typedef)[edit] | |
(C++11)(optional) | std::atomic<std::int8_t> (typedef)[edit] | |
(C++11)(optional) | std::atomic<std::uint8_t> (typedef)[edit] | |
(C++11)(optional) | std::atomic<std::int16_t> (typedef)[edit] | |
(C++11)(optional) | std::atomic<std::uint16_t> (typedef)[edit] | |
(C++11)(optional) | std::atomic<std::int32_t> (typedef)[edit] | |
(C++11)(optional) | std::atomic<std::uint32_t> (typedef)[edit] | |
(C++11)(optional) | std::atomic<std::int64_t> (typedef)[edit] | |
(C++11)(optional) | std::atomic<std::uint64_t> (typedef)[edit] | |
(C++11) | std::atomic<std::int_least8_t> (typedef)[edit] | |
(C++11) | std::atomic<std::uint_least8_t> (typedef)[edit] | |
(C++11) | std::atomic<std::int_least16_t> (typedef)[edit] | |
(C++11) | std::atomic<std::uint_least16_t> (typedef)[edit] | |
(C++11) | std::atomic<std::int_least32_t> (typedef)[edit] | |
(C++11) | std::atomic<std::uint_least32_t> (typedef)[edit] | |
(C++11) | std::atomic<std::int_least64_t> (typedef)[edit] | |
(C++11) | std::atomic<std::uint_least64_t> (typedef)[edit] | |
(C++11) | std::atomic<std::int_fast8_t> (typedef)[edit] | |
(C++11) | std::atomic<std::uint_fast8_t> (typedef)[edit] | |
(C++11) | std::atomic<std::int_fast16_t> (typedef)[edit] | |
(C++11) | std::atomic<std::uint_fast16_t> (typedef)[edit] | |
(C++11) | std::atomic<std::int_fast32_t> (typedef)[edit] | |
(C++11) | std::atomic<std::uint_fast32_t> (typedef)[edit] | |
(C++11) | std::atomic<std::int_fast64_t> (typedef)[edit] | |
(C++11) | std::atomic<std::uint_fast64_t> (typedef)[edit] | |
(C++11)(optional) | std::atomic<std::intptr_t> (typedef)[edit] | |
(C++11)(optional) | std::atomic<std::uintptr_t> (typedef)[edit] | |
(C++11) | std::atomic<std::size_t> (typedef)[edit] | |
(C++11) | std::atomic<std::ptrdiff_t> (typedef)[edit] | |
(C++11) | std::atomic<std::intmax_t> (typedef)[edit] | |
(C++11) | std::atomic<std::uintmax_t> (typedef)[edit] | |
Functions | ||
(C++11) | checks if the atomic type's operations are lock-free (function template)[edit] | |
(C++11)(C++11) | atomically replaces the value of the atomic object with a non-atomic argument (function template)[edit] | |
(C++11)(C++11) | atomically obtains the value stored in an atomic object (function template)[edit] | |
(C++11)(C++11) | atomically replaces the value of the atomic object with non-atomic argument and returns the old value of the atomic (function template)[edit] | |
atomically compares the value of the atomic object with non-atomic argument and performs atomic exchange if equal or atomic load if not (function template)[edit] | ||
(C++11)(C++11) | adds a non-atomic value to an atomic object and obtains the previous value of the atomic (function template)[edit] | |
(C++11)(C++11) | subtracts a non-atomic value from an atomic object and obtains the previous value of the atomic (function template)[edit] | |
(C++11)(C++11) | replaces the atomic object with the result of bitwise AND with a non-atomic argument and obtains the previous value of the atomic (function template)[edit] | |
(C++11)(C++11) | replaces the atomic object with the result of bitwise OR with a non-atomic argument and obtains the previous value of the atomic (function template)[edit] | |
(C++11)(C++11) | replaces the atomic object with the result of bitwise XOR with a non-atomic argument and obtains the previous value of the atomic (function template)[edit] | |
atomically sets the flag totrue and returns its previous value (function)[edit] | ||
(C++11)(C++11) | atomically sets the value of the flag tofalse (function)[edit] | |
(C++11) | generic memory order-dependent fence synchronization primitive (function)[edit] | |
(C++11) | fence between a thread and a signal handler executed in the same thread (function)[edit] |
template<class T>using __std_atomic=std::atomic<T>;// exposition only #define _Atomic(T) __std_atomic<T> #define ATOMIC_BOOL_LOCK_FREE /* see description */#define ATOMIC_CHAR_LOCK_FREE /* see description */#define ATOMIC_CHAR16_T_LOCK_FREE /* see description */#define ATOMIC_CHAR32_T_LOCK_FREE /* see description */#define ATOMIC_WCHAR_T_LOCK_FREE /* see description */#define ATOMIC_SHORT_LOCK_FREE /* see description */#define ATOMIC_INT_LOCK_FREE /* see description */#define ATOMIC_LONG_LOCK_FREE /* see description */#define ATOMIC_LLONG_LOCK_FREE /* see description */#define ATOMIC_POINTER_LOCK_FREE /* see description */ usingstd::memory_order;// see descriptionusingstd::memory_order_relaxed;// see descriptionusingstd::memory_order_consume;// see descriptionusingstd::memory_order_acquire;// see descriptionusingstd::memory_order_release;// see descriptionusingstd::memory_order_acq_rel;// see descriptionusingstd::memory_order_seq_cst;// see description usingstd::atomic_flag;// see description usingstd::atomic_bool;// see descriptionusingstd::atomic_char;// see descriptionusingstd::atomic_schar;// see descriptionusingstd::atomic_uchar;// see descriptionusingstd::atomic_short;// see descriptionusingstd::atomic_ushort;// see descriptionusingstd::atomic_int;// see descriptionusingstd::atomic_uint;// see descriptionusingstd::atomic_long;// see descriptionusingstd::atomic_ulong;// see descriptionusingstd::atomic_llong;// see descriptionusingstd::atomic_ullong;// see descriptionusingstd::atomic_char8_t;// see descriptionusingstd::atomic_char16_t;// see descriptionusingstd::atomic_char32_t;// see descriptionusingstd::atomic_wchar_t;// see descriptionusingstd::atomic_int8_t;// see descriptionusingstd::atomic_uint8_t;// see descriptionusingstd::atomic_int16_t;// see descriptionusingstd::atomic_uint16_t;// see descriptionusingstd::atomic_int32_t;// see descriptionusingstd::atomic_uint32_t;// see descriptionusingstd::atomic_int64_t;// see descriptionusingstd::atomic_uint64_t;// see descriptionusingstd::atomic_int_least8_t;// see descriptionusingstd::atomic_uint_least8_t;// see descriptionusingstd::atomic_int_least16_t;// see descriptionusingstd::atomic_uint_least16_t;// see descriptionusingstd::atomic_int_least32_t;// see descriptionusingstd::atomic_uint_least32_t;// see descriptionusingstd::atomic_int_least64_t;// see descriptionusingstd::atomic_uint_least64_t;// see descriptionusingstd::atomic_int_fast8_t;// see descriptionusingstd::atomic_uint_fast8_t;// see descriptionusingstd::atomic_int_fast16_t;// see descriptionusingstd::atomic_uint_fast16_t;// see descriptionusingstd::atomic_int_fast32_t;// see descriptionusingstd::atomic_uint_fast32_t;// see descriptionusingstd::atomic_int_fast64_t;// see descriptionusingstd::atomic_uint_fast64_t;// see descriptionusingstd::atomic_intptr_t;// see descriptionusingstd::atomic_uintptr_t;// see descriptionusingstd::atomic_size_t;// see descriptionusingstd::atomic_ptrdiff_t;// see descriptionusingstd::atomic_intmax_t;// see descriptionusingstd::atomic_uintmax_t;// see description usingstd::atomic_is_lock_free;// see descriptionusingstd::atomic_load;// see descriptionusingstd::atomic_load_explicit;// see descriptionusingstd::atomic_store;// see descriptionusingstd::atomic_store_explicit;// see descriptionusingstd::atomic_exchange;// see descriptionusingstd::atomic_exchange_explicit;// see descriptionusingstd::atomic_compare_exchange_strong;// see descriptionusingstd::atomic_compare_exchange_strong_explicit;// see descriptionusingstd::atomic_compare_exchange_weak;// see descriptionusingstd::atomic_compare_exchange_weak_explicit;// see descriptionusingstd::atomic_fetch_add;// see descriptionusingstd::atomic_fetch_add_explicit;// see descriptionusingstd::atomic_fetch_sub;// see descriptionusingstd::atomic_fetch_sub_explicit;// see descriptionusingstd::atomic_fetch_or;// see descriptionusingstd::atomic_fetch_or_explicit;// see descriptionusingstd::atomic_fetch_xor;// see descriptionusingstd::atomic_fetch_xor_explicit;// see descriptionusingstd::atomic_fetch_and;// see descriptionusingstd::atomic_fetch_and_explicit;// see descriptionusingstd::atomic_flag_test_and_set;// see descriptionusingstd::atomic_flag_test_and_set_explicit;// see descriptionusingstd::atomic_flag_clear;// see descriptionusingstd::atomic_flag_clear_explicit;// see description #define ATOMIC_FLAG_INIT /* see description */ usingstd::atomic_thread_fence;// see descriptionusingstd::atomic_signal_fence;// see description