std::atomic_flag::clear(3)
π
std::atomic_flag::clear(3) π
okay so bestie, this is the C++ Standard Libary page for std::atomic_flag::clear β yes, the manual name is literally right there, and weβre about to make it make sense. π«Ά
β¨ NAME β¨
std::atomic_flag::clear β std::atomic_flag::clear. Thatβs the name. Iconic, no notes. π
πΈ Synopsis πΈ
Defined in header <atomic>.
void clear( std::memory_order order = (1)
(since C++11)
std::memory_order_seq_cst ) volatile noexcept;
void clear( std::memory_order order = (2)
(since C++11)
std::memory_order_seq_cst ) noexcept;
So it atomically changes the state of a std::atomic_flag to clear (false). Thatβs the main character move. β¨
π¨ big warning, bestie: iforderis one ofstd::memory_order_consume,std::memory_order_acquireandstd::memory_order_acq_rel, the behavior is undefined. not a slay. do not do it.
π Parameters π
orderβ the memory synchronization ordering. thatβs the whole parameter, and itβs lowkey important.
π Defect reports π
the following behavior-changing defect reports were applied retroactively to previously published C++ standards. retroactive lore, fr fr.
- DR
LWG 2138β applied to C++11. Behavior as published:ordercould bestd::memory_order_consume. Correct behavior: the behavior is undefined in this case. π
π See also π
test_and_setβ atomically sets the flag to true and obtains its previous value (public member function)atomic_flag_clear(C++11) β atomically sets the value of the flag to false (function)atomic_flag_clear_explicit(C++11) β atomically sets the value of the flag to false (function)memory_order(C++11) β defines memory ordering constraints for the given atomic operation (enum)
cute sign-off time π: source is http://cppreference.com, version/date is 2024.06.10, and the page is std::atomic_flag::clear(3). bye bestie, go clear that flag safely, mwah πβ¨
π¦ 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