There are specializations of the
atomic_ref class template
for the floating-point types
float,
double, and
long double. For each such type
floating-point,
the specialization
atomic_ref<floating-point> provides
additional atomic operations appropriate to floating-point types
.
namespace std {
template<> struct atomic_ref<floating-point> {
private:
floating-point* ptr;
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;
};
}