std::atomic...st_explicit(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸŽ€ 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.
⚠️ If order is one of std::memory_order::release and std::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 the atomic_flag object 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

😭 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 of std::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