3-state boolean type¶
-
class
tribool
¶ A 3-state boolean type. The third state represents a superposition of the
true
andfalse
states.-
constexpr
tribool
() noexcept¶ Creates a new tribool, with the
false
value.
-
constexpr
tribool
(bool v) noexcept¶ Creates a new tribool, with the given value.
Parameters: v – the value of the new tribool
-
explicit constexpr
operator bool
() const noexcept¶ Returns: true
if the state is true;false
otherwise.
-
constexpr
-
constexpr tribool
operator!
(tribool t) noexcept¶ Negates a tribool.
Returns: maybe
if t ismaybe
; otherwise!bool(t)
-
constexpr tribool
operator&&
(tribool lhs, maybe_t rhs) noexcept¶ Logical conjunction of tribools.
Returns: maybe
if either side ismaybe
; otherwisebool(lhs) && bool(rhs)
-
constexpr tribool
operator||
(tribool lhs, maybe_t rhs) noexcept¶ Logical disjunction of tribools.
Returns: true
if either side istrue
; otherwisemaybe
if either side ismaybe
; otherwisefalse