From 2691a9d5abd49bb1f69ac717b5a19e13b0c46b27 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 28 Nov 2024 19:34:54 +0100 Subject: [PATCH] P2835R7 Expose std::atomic_ref's object address --- source/support.tex | 2 +- source/threads.tex | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/source/support.tex b/source/support.tex index 5d0bcb7694..a0643e2dea 100644 --- a/source/support.tex +++ b/source/support.tex @@ -577,7 +577,7 @@ #define @\defnlibxname{cpp_lib_atomic_is_always_lock_free}@ 201603L // freestanding, also in \libheader{atomic} #define @\defnlibxname{cpp_lib_atomic_lock_free_type_aliases}@ 201907L // also in \libheader{atomic} #define @\defnlibxname{cpp_lib_atomic_min_max}@ 202403L // freestanding, also in \libheader{atomic} -#define @\defnlibxname{cpp_lib_atomic_ref}@ 201806L // freestanding, also in \libheader{atomic} +#define @\defnlibxname{cpp_lib_atomic_ref}@ 202411L // freestanding, also in \libheader{atomic} #define @\defnlibxname{cpp_lib_atomic_shared_ptr}@ 201711L // also in \libheader{memory} #define @\defnlibxname{cpp_lib_atomic_value_initialization}@ 201911L // freestanding, also in \libheader{atomic}, \libheader{memory} #define @\defnlibxname{cpp_lib_atomic_wait}@ 201907L // freestanding, also in \libheader{atomic} diff --git a/source/threads.tex b/source/threads.tex index 7dfd5eafce..721e02a387 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -3154,6 +3154,7 @@ void wait(T, memory_order = memory_order::seq_cst) const noexcept; void notify_one() const noexcept; void notify_all() const noexcept; + constexpr T* address() const noexcept; }; } \end{codeblock} @@ -3539,6 +3540,17 @@ on atomic object \tcode{*ptr}. \end{itemdescr} +\indexlibrarymember{address}{atomic_ref}% +\begin{itemdecl} +constexpr T* address() const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +\tcode{ptr}. +\end{itemdescr} + \rSec3[atomics.ref.int]{Specializations for integral types} \pnum @@ -3631,6 +3643,7 @@ void wait(@\placeholdernc{integral-type}@, memory_order = memory_order::seq_cst) const noexcept; void notify_one() const noexcept; void notify_all() const noexcept; + constexpr @\placeholder{integral-type}@* address() const noexcept; }; } \end{codeblock} @@ -3760,6 +3773,7 @@ void wait(@\placeholdernc{floating-point-type}@, memory_order = memory_order::seq_cst) const noexcept; void notify_one() const noexcept; void notify_all() const noexcept; + constexpr @\placeholder{floating-point-type}@* address() const noexcept; }; } \end{codeblock} @@ -3871,6 +3885,7 @@ void wait(T*, memory_order = memory_order::seq_cst) const noexcept; void notify_one() const noexcept; void notify_all() const noexcept; + constexpr @\placeholder{pointer-type}@* address() const noexcept; }; } \end{codeblock}