Namespaces
Variants
Views
Actions

std::atomic::load

From cppreference.com
< cpp‎ | atomic‎ | atomic
Revision as of 17:45, 2 November 2012 by P12bot (Talk | contribs)

 
 
 
 

Template:ddcl list begin <tr class="t-dcl ">

<td >
T load( memory_order = std::memory_order_seq_cst ) const;
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
T load( memory_order = std::memory_order_seq_cst ) const volatile;
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end

Atomically loads and returns the current value of the atomic variable. Memory is affected according to the value of memory_order.

memory_order must be one of std::memory_order_relaxed, std::memory_order_consume, std::memory_order_acquire or std::memory_order_seq_cst. Otherwise the behavior is undefined.

Contents

Parameters

memory_order - memory order constraints to enforce

Return value

The current value of the atomic variable.

Exceptions

noexcept specification:  
noexcept
  

See also

Template:cpp/atomic/atomic/dcl list operator TTemplate:cpp/atomic/dcl list atomic load