std::atomic_flag_test, std::atomic_flag_test_explicit
From cppreference.com
| ヘッダー <atomic> で定義 |
||
| bool atomic_flag_test( const volatile std::atomic_flag* object ) noexcept; |
(1) | (C++20以降) |
| bool atomic_flag_test( const std::atomic_flag* object ) noexcept; |
(2) | (C++20以降) |
| bool atomic_flag_test_explicit( const volatile std::atomic_flag* object, std::memory_order order ) noexcept; |
(3) | (C++20以降) |
| bool atomic_flag_test_explicit( const std::atomic_flag* object, std::memory_order order ) noexcept; |
(4) | (C++20以降) |
アトミックに*objectの値を読み込み、その値を返します。
1,2) メモリ同期順序はstd::memory_order_seq_cstです。
3,4) メモリ同期順序はorderです。
orderがstd::memory_order::releaseまたはstd::memory_order::acq_relのいずれかである場合、動作は未定義です。
目次 |
[編集] パラメータ
| オブジェクト (object) | - | 読み取るatomic_flagオブジェクトへのポインタ |
| order | - | メモリ同期順序 |
[編集] 戻り値
アトミックに読み取られた値。
[編集] 注意
| 機能テストマクロ | 値 | 規格 | 機能 |
|---|---|---|---|
__cpp_lib_atomic_flag_test |
201907L |
(C++20) | std::atomic_flag::test
|
[編集] 例
| このセクションは未完成です 理由: 例がありません |
[編集] 関連項目
| (C++20) |
フラグの値をアトミックに返す ( std::atomic_flagのpublicメンバ関数) [[編集]] |