std::atomic_fetch_sub, std::atomic_fetch_sub_explicit
From cppreference.com
Defined in header <atomic>
|
||
template< class T > T atomic_fetch_sub( std::atomic<T>* obj, |
(1) | (since C++11) |
template< class T > T atomic_fetch_sub( volatile std::atomic<T>* obj, |
(2) | (since C++11) |
template< class T > T atomic_fetch_sub_explicit( std::atomic<T>* obj, |
(3) | (since C++11) |
template< class T > T atomic_fetch_sub_explicit( volatile std::atomic<T>* obj, |
(4) | (since C++11) |
Performs atomic subtraction. Atomically subtracts arg from the value pointed to by obj and returns the value obj held previously. The operation is performed as if the following was executed:
1,2) obj->fetch_sub(arg)
3,4) obj->fetch_sub(arg, order)
If std::atomic<T>
has no fetch_sub
member (this member is only provided for integral, floating-point(since C++20) and pointer types except bool), the program is ill-formed.
Contents |