std::atomic_fetch_or, std::atomic_fetch_or_explicit
From cppreference.com
Defined in header <atomic>
|
||
template< class Integral > Integral atomic_fetch_or( std::atomic<Integral>* obj, Integral arg ); |
(1) | (since C++11) |
template< class Integral > Integral atomic_fetch_or( volatile std::atomic<Integral>* obj, Integral arg ); |
(2) | (since C++11) |
template< class Integral > Integral atomic_fetch_or_explicit( std::atomic<Integral>* obj, Integral arg, |
(3) | (since C++11) |
template< class Integral > Integral atomic_fetch_or_explicit( volatile std::atomic<Integral>* obj, Integral arg, |
(4) | (since C++11) |
1-2) Atomically replaces the value pointed by arg with the result of bitwise OR between the old value of obj and arg, and returns the value obj held previously, as if by obj->fetch_and(arg)
3-4) Atomically replaces the value pointed by arg with the result of bitwise OR between the old value of obj and arg, and returns the value obj held previously, as if by obj->fetch_and(arg, order)
Contents |
[edit] Parameters
obj | - | pointer to the atomic object to modify |
arg | - | the value to bitwise OR to the value stored in the atomic object |
order | - | the memory sycnhronization ordering for this operation: all values are permitted. |
[edit] Return value
The value held previously by the atomic object pointed to by obj
[edit] Exceptions
[edit] Possible implementation
template< class T > typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value, T>::type atomic_fetch_or( std::atomic<T>* obj, T arg ); { return obj->fetch_or(arg); } |
[edit] Example
This section is incomplete Reason: no example |
[edit] See also
(C++11) |
atomically performs bitwise OR between the argument and the value of the atomic object and obtains the value held previously (public member function of std::atomic) |
(C++11) (C++11) |
replaces the atomic object with the result of logical AND with a non-atomic argument and obtains the previous value of the atomic (function template) |
(C++11) (C++11) |
replaces the atomic object with the result of logical XOR with a non-atomic argument and obtains the previous value of the atomic (function template) |