std::atomic_ref<T>::operator++,++(int),--,--(int)
Min standard notice:
Atomically increments or decrements the current value of the referenced object. These operations are read-modify-write operations.
# Declarations
Provided only when T is an integral type other than cv bool or a pointer-to-object type
value_type operator++() const noexcept;
(since C++20)
value_type operator++( int ) const noexcept;
(since C++20)
value_type operator--() const noexcept;
(since C++20)
value_type operator--( int ) const noexcept;
(since C++20)
# Notes
Unlike most pre-increment and pre-decrement operators, the pre-increment and pre-decrement operators for atomic_ref do not return a reference to the modified object. They return a copy of the stored value instead.
# Defect reports
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 3508(P3323R1) | C++20 | increment and decrement operators were meaningless for const T | constrained to accept only non-const T |