GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::atomic::atomic(3) C++ Standard Libary std::atomic::atomic(3)

std::atomic::atomic - std::atomic::atomic


(since
atomic() noexcept = default; C++11)
(until
C++20)
constexpr atomic() (1) (since
noexcept(std::is_nothrow_default_constructible_v<T>); C++20)
constexpr atomic( T desired ) noexcept; (2) (since
C++11)
atomic( const atomic& ) = delete; (3) (since
C++11)


Constructs new atomic variable.


1) The default constructor is trivial: no initialization takes place
other than zero initialization of static and thread-local objects. (until C++20)
std::atomic_init may be used to complete initialization.
1) Value-initializes the underlying object (i.e. with T()). The
initialization is not atomic. Use of the default constructor is (since C++20)
ill-formed if std::is_default_constructible_v<T> is false.


2) Initializes the underlying object with desired. The initialization is not atomic.
3) Atomic variables are not CopyConstructible.


desired - value to initialize with


The default-initialized std::atomic<T> does not contain a T object,
and its only valid uses are destruction and initialization by (until C++20)
std::atomic_init, see LWG 2334

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.