std::atomic...st_explicit(3)
π NAME π
okay so bestie, this page is from the C++ Standard Libary manual and its header is std::atomic...st_explicit(3). The NAME block is literally this, and we are not changing a single character π
:
std::atomic_flag_test,std::atomic_flag_test_explicit -
std::atomic_flag_test,std::atomic_flag_test_explicit
periodt. Those are the two names, fr fr.
β¨ Synopsis β¨
the synopsis is a whole mood, but copy it exactly:
Defined in header <atomic>
bool atomic_flag_test( const volatile std::atomic_flag* object )
(1) (since C++20)
noexcept;
bool atomic_flag_test( const std::atomic_flag* object ) noexcept;
(2) (since C++20)
bool atomic_flag_test_explicit( const volatile std::atomic_flag*
object,
(3) (since C++20)
std::memory_order order )
noexcept;
bool atomic_flag_test_explicit( const std::atomic_flag* object,
std::memory_order order )
(4) (since C++20)
noexcept;
Atomically reads the value of the *object and returns the value.
- 1,2) The memory synchronization order is
std::memory_order_seq_cst. - 3,4) The memory synchronization order is
order.
β οΈ Iforderis one ofstd::memory_order::releaseandstd::memory_order::acq_rel, the behavior is undefined. That's not a vibe check, that's literally undefined behavior π β do not do it, bestie.
πΈ Parameters πΈ
objectβ pointer to theatomic_flagobject to read.orderβ the memory synchronization ordering.
π¦ Return value π¦
The value atomically read. iconic, honestly.
π Notes π
the feature-test macro situation is giving:
- Macro:
__cpp_lib_atomic_flag_test- Value:
201907L - Std:
C++20 - Feature:
std::atomic_flag::test
- Value:
π Example π
This section is incomplete Reason: no example
not me showing up with no example ππ
π₯ See also π₯
testβ atomically returns the value of the flag (C++20) (public member function ofstd::atomic_flag).
π Category π
* Todo no example
mwah π β source/version: http://cppreference.com Β· date: 2024.06.10 Β· page: std::atomic...st_explicit(3)
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms