There are specializations of the
atomic
class template for the floating-point types
float,
double, and
long double. For each such type
floating-point,
the specialization
atomic<floating-point>
provides additional atomic operations appropriate to floating-point types
.
namespace std {
template<> struct atomic<floating-point> {
using value_type = floating-point;
using difference_type = value_type;
static constexpr bool is_always_lock_free = implementation-defined;
bool is_lock_free() const volatile noexcept;
bool is_lock_free() const noexcept;
constexpr atomic() noexcept;
constexpr atomic(floating-point) noexcept;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
void store(floating-point, memory_order = memory_order::seq_cst) volatile noexcept;
void store(floating-point, memory_order = memory_order::seq_cst) noexcept;
floating-point operator=(floating-point) volatile noexcept;
floating-point operator=(floating-point) noexcept;
floating-point load(memory_order = memory_order::seq_cst) volatile noexcept;
floating-point load(memory_order = memory_order::seq_cst) noexcept;
operator floating-point() volatile noexcept;
operator floating-point() noexcept;
floating-point exchange(floating-point,
memory_order = memory_order::seq_cst) volatile noexcept;
floating-point exchange(floating-point,
memory_order = memory_order::seq_cst) noexcept;
bool compare_exchange_weak(floating-point&, floating-point,
memory_order, memory_order) volatile noexcept;
bool compare_exchange_weak(floating-point&, floating-point,
memory_order, memory_order) noexcept;
bool compare_exchange_strong(floating-point&, floating-point,
memory_order, memory_order) volatile noexcept;
bool compare_exchange_strong(floating-point&, floating-point,
memory_order, memory_order) noexcept;
bool compare_exchange_weak(floating-point&, floating-point,
memory_order = memory_order::seq_cst) volatile noexcept;
bool compare_exchange_weak(floating-point&, floating-point,
memory_order = memory_order::seq_cst) noexcept;
bool compare_exchange_strong(floating-point&, floating-point,
memory_order = memory_order::seq_cst) volatile noexcept;
bool compare_exchange_strong(floating-point&, floating-point,
memory_order = memory_order::seq_cst) noexcept;
floating-point fetch_add(floating-point,
memory_order = memory_order::seq_cst) volatile noexcept;
floating-point fetch_add(floating-point,
memory_order = memory_order::seq_cst) noexcept;
floating-point fetch_sub(floating-point,
memory_order = memory_order::seq_cst) volatile noexcept;
floating-point fetch_sub(floating-point,
memory_order = memory_order::seq_cst) noexcept;
floating-point operator+=(floating-point) volatile noexcept;
floating-point operator+=(floating-point) noexcept;
floating-point operator-=(floating-point) volatile noexcept;
floating-point operator-=(floating-point) noexcept;
void wait(floating-point, memory_order = memory_order::seq_cst) const volatile noexcept;
void wait(floating-point, memory_order = memory_order::seq_cst) const noexcept;
void notify_one() volatile noexcept;
void notify_one() noexcept;
void notify_all() volatile noexcept;
void notify_all() noexcept;
};
}