|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
void store( value_type desired, std::memory_order order= | (constexpr since C++26) | |
Atomically replaces the current value of the referenced object withdesired. Memory is affected according to the value oforder.
This overload participates in overload resolution only ifstd::is_const_v<T> isfalse.
Iforder is notstd::memory_order_relaxed,std::memory_order_release orstd::memory_order_seq_cst, the behavior is undefined.
| desired | - | the value to store into the referenced object |
| order | - | memory order constraints to enforce |
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 3508 (P3323R1) | C++20 | store was meaningless forconst T | constrained to accept only non-constT |
stores a value into the object referenced by anatomic_ref object(public member function)[edit] |