VIPRA Documentation
Loading...
Searching...
No Matches
bool_latch.hpp
1#pragma once
2
3#include "vipra/vipra_behaviors/util/class_types.hpp"
4
5namespace VIPRA::Behaviors {
10class Latch {
11 DEFAULT_CONSTRUCTIBLE(Latch)
12 COPYABLE(Latch)
13 MOVEABLE(Latch)
14 public:
15 inline void latch() { _set = true; }
16
17 inline void unlatch() { _set = false; }
18
19 [[nodiscard]] inline explicit operator bool() const { return _set; }
20
21 private:
22 bool _set = false;
23};
24} // namespace VIPRA::Behaviors
Literally a boolean with extra syntax.
Definition bool_latch.hpp:10