68 constexpr explicit bool_class(
bool v) noexcept : _value(v) { }
71 explicit operator bool() const noexcept {
return _value; }
93 return os << (v._value ?
"true" :
"false");
98const bool_class<Tag> bool_class<Tag>::yes {
true };
100const bool_class<Tag> bool_class<Tag>::no {
false };
106template<
typename Tag>
107struct fmt::formatter<
seastar::bool_class<Tag>> {
108 constexpr auto parse(format_parse_context& ctx) {
return ctx.begin(); }
109 template <
typename FormatContext>
111 return fmt::format_to(ctx.out(),
"{}",
bool(v));
Type-safe boolean.
Definition: bool_class.hh:58
friend bool_class operator&&(bool_class x, bool_class y) noexcept
Logical AND.
Definition: bool_class.hh:79
constexpr bool_class() noexcept
Constructs a bool_class object initialised to false.
Definition: bool_class.hh:65
friend bool operator==(bool_class x, bool_class y) noexcept=default
Equal-to and not-equal-to operators.
friend std::ostream & operator<<(std::ostream &os, bool_class v)
Prints bool_class value to an output stream.
Definition: bool_class.hh:92
friend bool_class operator!(bool_class x) noexcept
Logical NOT.
Definition: bool_class.hh:84
friend bool_class operator||(bool_class x, bool_class y) noexcept
Logical OR.
Definition: bool_class.hh:74
constexpr bool_class(bool v) noexcept
Constructs a bool_class object initialised to v.
Definition: bool_class.hh:68
Seastar API namespace.
Definition: abort_on_ebadf.hh:26