atomic::atomic Constructor

atomic::atomic Constructor


Constructs an atomic object.

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


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);


Header: atomic

Namespace: std

© 2016 Microsoft