3-state boolean type

class maybe_t

The unit type of the maybe constant.

constexpr bool operator()(tribool t) const noexcept
Parameters:t – a tribool to check for a maybe state
Returns:true if t is maybe; false otherwise
constexpr maybe_t maybe

A constant used to represent the third boolean state.

class tribool

A 3-state boolean type. The third state represents a superposition of the true and false 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
constexpr tribool(maybe_t) noexcept

Creates a new tribool, with the maybe state.

explicit constexpr operator bool() const noexcept
Returns:true if the state is true; false otherwise.

Note

This feature is only available if the OGONEK_USE_BOOST macro is set.

constexpr tribool(boost::tribool t) noexcept

Creates a new tribool with the value of a boost::tribool.

constexpr operator boost::tribool() const noexcept
Returns:a boost::tribool equivalent to this tribool.
constexpr tribool operator!(tribool t) noexcept

Negates a tribool.

Returns:maybe if t is maybe; otherwise !bool(t)
constexpr tribool operator&&(tribool lhs, tribool rhs) noexcept
constexpr tribool operator&&(tribool lhs, bool rhs) noexcept
constexpr tribool operator&&(bool lhs, tribool rhs) noexcept
constexpr tribool operator&&(maybe_t lhs, tribool rhs) noexcept
constexpr tribool operator&&(tribool lhs, maybe_t rhs) noexcept

Logical conjunction of tribools.

Returns:maybe if either side is maybe; otherwise bool(lhs) && bool(rhs)
constexpr tribool operator||(tribool lhs, tribool rhs) noexcept
constexpr tribool operator||(tribool lhs, bool rhs) noexcept
constexpr tribool operator||(bool lhs, tribool rhs) noexcept
constexpr tribool operator||(maybe_t lhs, tribool rhs) noexcept
constexpr tribool operator||(tribool lhs, maybe_t rhs) noexcept

Logical disjunction of tribools.

Returns:true if either side is true; otherwise maybe if either side is maybe; otherwise false
constexpr tribool operator==(tribool lhs, tribool rhs) noexcept
constexpr tribool operator==(tribool lhs, bool rhs) noexcept
constexpr tribool operator==(bool lhs, tribool rhs) noexcept
constexpr tribool operator==(maybe_t lhs, tribool rhs) noexcept
constexpr tribool operator==(tribool lhs, maybe_t rhs) noexcept

Compares tribools for equality.

Returns:maybe if either side is maybe; otherwise bool(lhs) == bool(rhs)
constexpr tribool operator!=(tribool lhs, tribool rhs) noexcept
constexpr tribool operator!=(tribool lhs, bool rhs) noexcept
constexpr tribool operator!=(bool lhs, tribool rhs) noexcept
constexpr tribool operator!=(maybe_t lhs, tribool rhs) noexcept
constexpr tribool operator!=(tribool lhs, maybe_t rhs) noexcept

Compares tribools for inequality.

Returns:maybe if either side is maybe; otherwise bool(lhs) != bool(rhs)