atomic::atomic Constructor

atomic::atomic Constructor

 

Constructs an atomic object.

atomic();
atomic( const atomic& );
atomic( Ty Val ) _NOEXCEPT;

_Val

Initialization value.

Atomic objects cannot be copied or moved.

Objects that are instantiations of atomic<Ty> can be initialized only by the constructor that takes an argument of type Ty and not by using aggregate initialization. However, atomic_integral objects can be initialized only by using aggregate initialization.

atomic<int> ai0 = ATOMIC_VAR_INIT(0);
atomic<int> ai1(0);

Requirements

Header: atomic

Namespace: std

Show:
© 2016 Microsoft