WarnOnceFlag class
#include <gtopt/warn_once.hpp>
One-shot latch: fire() returns true for exactly one caller, across all threads, over the lifetime of the flag.
Constructors, destructors, conversion operators
- WarnOnceFlag() defaulted constexpr noexcept
- WarnOnceFlag(const WarnOnceFlag&) deleted
- WarnOnceFlag(WarnOnceFlag&&) deleted
- ~WarnOnceFlag() defaulted
Public functions
- auto fire() -> bool noexcept
- Latch the flag; true only for the call that latched it.
- auto fired() const -> bool noexcept
- True once any caller has latched the flag.
- auto operator=(const WarnOnceFlag&) -> WarnOnceFlag& deleted
- auto operator=(WarnOnceFlag&&) -> WarnOnceFlag& deleted