Namespaces
Variants
Views
Actions

std::atomic::atomic

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

 
 
 
 

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

<td >
atomic() = default;
</td>

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

<td >
constexpr atomic( T desired );
</td>

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

<td >
atomic( const atomic& ) = delete;
</td>

<td > (3) </td> <td > (since C++11) </td> </tr> Template:ddcl list end

Constructs new atomic variable.

1) The default constructor is trivial: no initialization takes place other than zero initialization of static and thread-local objects. std::atomic_init may be used to complete initialization.
2) Initializes the underlying value with desired. The initialization is not atomic.
3) Atomic variables are not CopyConstructible.

Parameters

desired - value to initialize with

Exceptions

noexcept specification:  
noexcept