|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
atomic::operator= | ||||
(C++20) | ||||
(C++20) | ||||
(C++20) | ||||
| Constants | ||||
(C++17) | ||||
| Specialized member functions | ||||
| Specialized for integral, floating-point(C++20) and pointer types | ||||
| Specialized for integral and pointer types only | ||||
(C++26) | ||||
(C++26) | ||||
| Specialized for integral types only | ||||
T operator=( T desired)noexcept; | (1) | (since C++11) |
T operator=( T desired)volatilenoexcept; | (2) | (since C++11) |
atomic& operator=(const atomic&)= delete; | (3) | (since C++11) |
atomic& operator=(const atomic&)volatile= delete; | (4) | (since C++11) |
It is deprecated ifstd::atomic<T>::is_always_lock_free isfalse and overload(2) participates in overload resolution. | (since C++20) |
Contents |
| desired | - | value to assign |
Unlike most assignment operators, the assignment operators for atomic types do not return a reference to their left-hand arguments. They return a copy of the stored value instead.
| constructs an atomic object (public member function)[edit] |