Namespaces
Variants

std::atomic_flag:: atomic_flag

From cppreference.net
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
Generic lock management
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
Safe reclamation
Hazard pointers
Atomic types
(C++11)
(C++20)
Initialization of atomic types
(C++11) (deprecated in C++20)
(C++11) (deprecated in C++20)
Memory ordering
(C++11) (deprecated in C++26)
Free functions for atomic operations
Free functions for atomic flags
ヘッダーで定義 <atomic>
(1)
atomic_flag ( ) noexcept = default ;
(C++11以降)
(C++20まで)
constexpr atomic_flag ( ) noexcept ;
(C++20以降)
atomic_flag ( const atomic_flag & ) = delete ;
(2) (C++11以降)

std::atomic_flag を新しく構築します。

1) 自明なデフォルトコンストラクタ、 std::atomic_flag を未規定の状態に初期化する。
(C++20まで)
1) std::atomic_flag をクリア状態に初期化する。
(C++20以降)
2) コピーコンストラクタは削除されています; std::atomic_flag はコピーできません。

さらに、 std::atomic_flag ATOMIC_FLAG_INIT 式でクリア状態に値初期化できます。静的 ストレージ期間 を持つ atomic_flag の場合、これは 静的初期化 を保証します:このフラグは静的オブジェクトのコンストラクタで使用できます。

関連項目

std::atomic_flag false に初期化する
(マクロ定数)