namespace std { template<class T> struct atomic_ref { private: T* ptr; // exposition only public: using value_type = T; static constexpr size_t required_alignment = implementation-defined; static constexpr bool is_always_lock_free = implementation-defined; bool is_lock_free() const noexcept; explicit atomic_ref(T&); atomic_ref(const atomic_ref&) noexcept; atomic_ref& operator=(const atomic_ref&) = delete; void store(T, memory_order = memory_order::seq_cst) const noexcept; T operator=(T) const noexcept; T load(memory_order = memory_order::seq_cst) const noexcept; operator T() const noexcept; T exchange(T, memory_order = memory_order::seq_cst) const noexcept; bool compare_exchange_weak(T&, T, memory_order, memory_order) const noexcept; bool compare_exchange_strong(T&, T, memory_order, memory_order) const noexcept; bool compare_exchange_weak(T&, T, memory_order = memory_order::seq_cst) const noexcept; bool compare_exchange_strong(T&, T, memory_order = memory_order::seq_cst) const noexcept; void wait(T, memory_order = memory_order::seq_cst) const noexcept; void notify_one() const noexcept; void notify_all() const noexcept; }; }
static constexpr size_t required_alignment;
static constexpr bool is_always_lock_free;
bool is_lock_free() const noexcept;
atomic_ref(T& obj);
atomic_ref(const atomic_ref& ref) noexcept;
void store(T desired, memory_order order = memory_order::seq_cst) const noexcept;
T operator=(T desired) const noexcept;
T load(memory_order order = memory_order::seq_cst) const noexcept;
operator T() const noexcept;
T exchange(T desired, memory_order order = memory_order::seq_cst) const noexcept;
bool compare_exchange_weak(T& expected, T desired,
memory_order success, memory_order failure) const noexcept;
bool compare_exchange_strong(T& expected, T desired,
memory_order success, memory_order failure) const noexcept;
bool compare_exchange_weak(T& expected, T desired,
memory_order order = memory_order::seq_cst) const noexcept;
bool compare_exchange_strong(T& expected, T desired,
memory_order order = memory_order::seq_cst) const noexcept;
void wait(T old, memory_order order = memory_order::seq_cst) const noexcept;
void notify_one() const noexcept;
void notify_all() const noexcept;
namespace std { template<> struct atomic_ref<integral> { private: integral* ptr; // exposition only public: using value_type = integral; using difference_type = value_type; static constexpr size_t required_alignment = implementation-defined; static constexpr bool is_always_lock_free = implementation-defined; bool is_lock_free() const noexcept; explicit atomic_ref(integral&); atomic_ref(const atomic_ref&) noexcept; atomic_ref& operator=(const atomic_ref&) = delete; void store(integral, memory_order = memory_order::seq_cst) const noexcept; integral operator=(integral) const noexcept; integral load(memory_order = memory_order::seq_cst) const noexcept; operator integral() const noexcept; integral exchange(integral, memory_order = memory_order::seq_cst) const noexcept; bool compare_exchange_weak(integral&, integral, memory_order, memory_order) const noexcept; bool compare_exchange_strong(integral&, integral, memory_order, memory_order) const noexcept; bool compare_exchange_weak(integral&, integral, memory_order = memory_order::seq_cst) const noexcept; bool compare_exchange_strong(integral&, integral, memory_order = memory_order::seq_cst) const noexcept; integral fetch_add(integral, memory_order = memory_order::seq_cst) const noexcept; integral fetch_sub(integral, memory_order = memory_order::seq_cst) const noexcept; integral fetch_and(integral, memory_order = memory_order::seq_cst) const noexcept; integral fetch_or(integral, memory_order = memory_order::seq_cst) const noexcept; integral fetch_xor(integral, memory_order = memory_order::seq_cst) const noexcept; integral operator++(int) const noexcept; integral operator--(int) const noexcept; integral operator++() const noexcept; integral operator--() const noexcept; integral operator+=(integral) const noexcept; integral operator-=(integral) const noexcept; integral operator&=(integral) const noexcept; integral operator|=(integral) const noexcept; integral operator^=(integral) const noexcept; void wait(integral, memory_order = memory_order::seq_cst) const noexcept; void notify_one() const noexcept; void notify_all() const noexcept; }; }
integral fetch_key(integral operand, memory_order order = memory_order::seq_cst) const noexcept;
integral operator op=(integral operand) const noexcept;
namespace std { template<> struct atomic_ref<floating-point> { private: floating-point* ptr; // exposition only public: using value_type = floating-point; using difference_type = value_type; static constexpr size_t required_alignment = implementation-defined; static constexpr bool is_always_lock_free = implementation-defined; bool is_lock_free() const noexcept; explicit atomic_ref(floating-point&); atomic_ref(const atomic_ref&) noexcept; atomic_ref& operator=(const atomic_ref&) = delete; void store(floating-point, memory_order = memory_order::seq_cst) const noexcept; floating-point operator=(floating-point) const noexcept; floating-point load(memory_order = memory_order::seq_cst) const noexcept; operator floating-point() const noexcept; floating-point exchange(floating-point, memory_order = memory_order::seq_cst) const noexcept; bool compare_exchange_weak(floating-point&, floating-point, memory_order, memory_order) const noexcept; bool compare_exchange_strong(floating-point&, floating-point, memory_order, memory_order) const noexcept; bool compare_exchange_weak(floating-point&, floating-point, memory_order = memory_order::seq_cst) const noexcept; bool compare_exchange_strong(floating-point&, floating-point, memory_order = memory_order::seq_cst) const noexcept; floating-point fetch_add(floating-point, memory_order = memory_order::seq_cst) const noexcept; floating-point fetch_sub(floating-point, memory_order = memory_order::seq_cst) const noexcept; floating-point operator+=(floating-point) const noexcept; floating-point operator-=(floating-point) const noexcept; void wait(floating-point, memory_order = memory_order::seq_cst) const noexcept; void notify_one() const noexcept; void notify_all() const noexcept; }; }
floating-point fetch_key(floating-point operand,
memory_order order = memory_order::seq_cst) const noexcept;
floating-point operator op=(floating-point operand) const noexcept;
namespace std { template<class T> struct atomic_ref<T*> { private: T** ptr; // exposition only public: using value_type = T*; using difference_type = ptrdiff_t; static constexpr size_t required_alignment = implementation-defined; static constexpr bool is_always_lock_free = implementation-defined; bool is_lock_free() const noexcept; explicit atomic_ref(T*&); atomic_ref(const atomic_ref&) noexcept; atomic_ref& operator=(const atomic_ref&) = delete; void store(T*, memory_order = memory_order::seq_cst) const noexcept; T* operator=(T*) const noexcept; T* load(memory_order = memory_order::seq_cst) const noexcept; operator T*() const noexcept; T* exchange(T*, memory_order = memory_order::seq_cst) const noexcept; bool compare_exchange_weak(T*&, T*, memory_order, memory_order) const noexcept; bool compare_exchange_strong(T*&, T*, memory_order, memory_order) const noexcept; bool compare_exchange_weak(T*&, T*, memory_order = memory_order::seq_cst) const noexcept; bool compare_exchange_strong(T*&, T*, memory_order = memory_order::seq_cst) const noexcept; T* fetch_add(difference_type, memory_order = memory_order::seq_cst) const noexcept; T* fetch_sub(difference_type, memory_order = memory_order::seq_cst) const noexcept; T* operator++(int) const noexcept; T* operator--(int) const noexcept; T* operator++() const noexcept; T* operator--() const noexcept; T* operator+=(difference_type) const noexcept; T* operator-=(difference_type) const noexcept; void wait(T*, memory_order = memory_order::seq_cst) const noexcept; void notify_one() const noexcept; void notify_all() const noexcept; }; }
T* fetch_key(difference_type operand, memory_order order = memory_order::seq_cst) const noexcept;
T* operator op=(difference_type operand) const noexcept;
value_type operator++(int) const noexcept;
value_type operator--(int) const noexcept;
value_type operator++() const noexcept;
value_type operator--() const noexcept;