C++ Atomic Library - fetch or



Description

It atomically performs bitwise OR between the argument and the value of the atomic object and obtains the value held previously.

Declaration

Following is the declaration for std::atomic::fetch_or.

T fetch_or( T arg, 
            std::memory_order order = std::memory_order_seq_cst );

C++11

T fetch_or( T arg, 
            std::memory_order order = std::memory_order_seq_cst ) volatile;

Parameters

  • arg − It is used put the other argument of of bitwise OR

  • order − It is used enforce the memory order for the value.

Return Value

It returns the value immediately preceding the effects of this function in the modification order of *this.

Exceptions

No-noexcept − this member function never throws exceptions.

atomic.htm
Advertisements