std::atomic_fetch_add, std::atomic_fetch_add_explicit
Template:cpp/atomic/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td><atomic>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td >Integral atomic_fetch_add( std::atomic<Integral>* obj, Integral arg );
<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >Integral atomic_fetch_add( volatile std::atomic<Integral>* obj, Integral arg );
<td > (2) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >Integral atomic_fetch_add_explicit( std::atomic<Integral>* obj, Integral arg,
<td > (3) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >Integral atomic_fetch_add_explicit( volatile std::atomic<Integral>* obj, Integral arg,
<td > (4) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >T* atomic_fetch_add( std::atomic<T*>* obj, std::ptrdiff_t arg );
<td > (5) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >T* atomic_fetch_add( volatile std::atomic<T*>* obj, std::ptrdiff_t arg );
<td > (6) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >T* atomic_fetch_add_explicit( std::atomic<T*>* obj, std::ptrdiff_t arg,
<td > (7) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >T* atomic_fetch_add_explicit( volatile std::atomic<T*>* obj, std::ptrdiff_t arg,
<td > (8) </td> <td > (since C++11) </td> </tr> Template:ddcl list end
1-2) Atomically adds arg
to the value pointed to by obj
and returns the value obj
held previously, as if by Template:cpp
3-4) Atomically adds arg
to the value pointed to by obj
and returns the value obj
held previously, as if by Template:cpp
5-6) Atomically increments the pointer value, pointed to by obj
, by arg
, and returns the value obj
held previously, as if by Template:cpp
7-8) Atomically increments the pointer value, pointed to by obj
, by arg
, and returns the value obj
held previously, as if by Template:cpp
Contents |
Parameters
obj | - | pointer to the atomic object to modify |
arg | - | the value to add to the value stored in the atomic object |
order | - | the memory sycnhronization ordering for this operation: all values are permitted. |
Return value
The value held previously by the atomic object pointed to by obj