This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Immediate status.
std::atomic_ref<T>::store_key should be disabled for const TSection: 32.5.7.3 [atomics.ref.int] Status: Immediate Submitter: Jonathan Wakely Opened: 2025-11-05 Last modified: 2025-11-05
Priority: Not Prioritized
View all issues with Immediate status.
Discussion:
Addresses US 193-311
The new store_key functions modify the object,
so it can't be const.
[Kona 2025-11-05; approved by LWG. Status changed: New → Immediate.]
Proposed resolution:
This wording is relative to N5014.
Modify 32.5.7.3 [atomics.ref.int], as indicated:
constexpr void store_key(value_type operand, memory_order order = memory_order::seq_cst) const noexcept;-?- Constraints:
is_const_v<integral-type>isfalse.-10- Preconditions:
orderismemory_order::relaxed,memory_order::release, ormemory_order::seq_cst.-11- Effects: Atomically replaces the value referenced by
*ptrwith the result of the computation applied to the value referenced by*ptrand the givenoperand. Memory is affected according to the value oforder. These operations are atomic modify-write operations (32.5.4 [atomics.order]).
Modify 32.5.7.4 [atomics.ref.float], as indicated:
constexpr void store_key(value_type operand, memory_order order = memory_order::seq_cst) const noexcept;-?- Constraints:
is_const_v<floating-point-type>isfalse.-10- Preconditions:
orderismemory_order::relaxed,memory_order::release, ormemory_order::seq_cst.-11- Effects: Atomically replaces the value referenced by
*ptrwith the result of the computation applied to the value referenced by*ptrand the givenoperand. Memory is affected according to the value oforder. These operations are atomic modify-write operations (32.5.4 [atomics.order]).
Modify 32.5.7.5 [atomics.ref.pointer], as indicated:
constexpr void store_key(see above operand, memory_order order = memory_order::seq_cst) const noexcept;-?- Constraints:
is_const_v<pointer-type>isfalse.-11- Mandates:
Tis a complete object type.-12- Preconditions:
orderismemory_order::relaxed,memory_order::release, ormemory_order::seq_cst.-13- Effects: Atomically replaces the value referenced by
*ptrwith the result of the computation applied to the value referenced by*ptrand the givenoperand. Memory is affected according to the value oforder. These operations are atomic modify-write operations (32.5.4 [atomics.order]).