Seastar
High performance C++ framework for concurrent servers
|
Type-safe boolean.
bool_class objects are type-safe boolean values that cannot be implicitly casted to untyped bools, integers or different bool_class types while still provides all relevant logical and comparison operators.
bool_class template parameter is a tag type that is going to be used to distinguish booleans of different types.
Usage examples:
Tag | type used as a tag |
#include <seastar/util/bool_class.hh>
Public Member Functions | |
constexpr | bool_class () noexcept |
Constructs a bool_class object initialised to false . | |
constexpr | bool_class (bool v) noexcept |
Constructs a bool_class object initialised to v . | |
operator bool () const noexcept | |
Casts a bool_class object to an untyped bool . | |
Static Public Attributes | |
static const bool_class | yes { true } |
static const bool_class | no { false } |