From 82bac2a864d155ecf74dd30ac7b3fddc0e8e9de4 Mon Sep 17 00:00:00 2001 From: Damien L-G Date: Tue, 4 Nov 2025 10:56:08 -1000 Subject: [PATCH] P3860R1: Address LWG feedback --- atomic.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/atomic.md b/atomic.md index ab4df7e..7a7399d 100644 --- a/atomic.md +++ b/atomic.md @@ -14,6 +14,10 @@ toc: true # Revision History ## R1 - Added `noexcept` specifier. +- Changed constraints wording to say "`T` and `U` are similar types" per LWG feedback +- Added converting constructor to specializations for integral types +- Added converting constructor to specializations for floating-point types +- Added converting constructor to specializations for pointer types ## R0 - Initial revision @@ -49,7 +53,7 @@ constexpr atomic_ref(const atomic_ref& ref) noexcept; [9]{.pnum} *Contraints*: -- [9.1]{.pnum} `is_same_v, remove_cv_t>` is `true`, and +- [9.1]{.pnum} `T` and `U` are similar types ([conv.qual]), and - [9.2]{.pnum} `is_convertible_v` is `true` @@ -57,6 +61,33 @@ constexpr atomic_ref(const atomic_ref& ref) noexcept; ::: +Change [atomics.ref.int]{.sref} as follows: + +```cpp + constexpr explicit atomic_ref(integral-type&); + constexpr atomic_ref(const atomic_ref&) noexcept; + @[`template `]{.add}@ + @[`constexpr atomic_ref(const atomic_ref&) noexcept;`]{.add}@ +``` + +Change [atomics.ref.float]{.sref} as follows: + +```cpp + constexpr explicit atomic_ref(floating-point-type&); + constexpr atomic_ref(const atomic_ref&) noexcept; + @[`template `]{.add}@ + @[`constexpr atomic_ref(const atomic_ref&) noexcept;`]{.add}@ +``` + +Change [atomics.ref.pointer]{.sref} as follows: + +```cpp + constexpr explicit atomic_ref(pointer-type&); + constexpr atomic_ref(const atomic_ref&) noexcept; + @[`template `]{.add}@ + @[`constexpr atomic_ref(const atomic_ref&) noexcept;`]{.add}@ +``` + # Implementation Experience [@P3323R1] is currently being implemented in libc++ and adding the proposed constructor is under way.