Loading...
Searching...
No Matches
apache::subversion::svnxx::tristate Class Reference

A three-state Boolean-like type. More...

`#include <svnxx/tristate.hpp>`

## Public Member Functions

constexpr | tristate (bool initial_value) noexcept
| Constructor for the true and false states.
constexpr | operator safe_bool () const noexcept
| Safe conversion to `bool`.
constexpr tristate | operator! () const noexcept
| Logical negation.
constexpr | tristate (boost::tribool t) noexcept
| Conversion from boost::tribool.
constexpr | operator boost::tribool () const noexcept
| Conversion to boost::tribool.

## Static Public Member Functions

static constexpr tristate | unknown () noexcept
| Factory method for the unknown state.

## Related Symbols

(Note that these are not member symbols.)
constexpr bool | unknown (tristate t) noexcept
| Test for the unknown `tristate` state.
constexpr tristate | operator&& (tristate t, tristate u) noexcept
| Logical conjunction.
constexpr tristate | operator&& (tristate t, bool b) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator&& (bool b, tristate t) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator&& (tristate t, boost::tribool b) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator&& (boost::tribool b, tristate t) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator|| (tristate t, tristate u) noexcept
| Logical disjunction.
constexpr tristate | operator|| (tristate t, bool b) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator|| (bool b, tristate t) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator|| (tristate t, boost::tribool b) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator|| (boost::tribool b, tristate t) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator== (tristate t, tristate u) noexcept
| Equality comparison.
constexpr tristate | operator== (tristate t, bool b) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator== (bool b, tristate t) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator== (tristate t, boost::tribool b) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator== (boost::tribool b, tristate t) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator!= (tristate t, tristate u) noexcept
| Inquality comparison.
constexpr tristate | operator!= (tristate t, bool b) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator!= (bool b, tristate t) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator!= (tristate t, boost::tribool b) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr tristate | operator!= (boost::tribool b, tristate t) noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## Detailed Description

A three-state Boolean-like type.

`tristate` values represent one of three states:

- the true state (equivalent to Boolean `true`);
- the false state (equivalent to Boolean `false`);
- the unknown state.

`tristate` constructors, methods and operators are all compile-time constant expressions and can be used to initialize other `constexpr` values. And unlike most other types, comparisons and logical operations between `tristate` values return a `tristate`, not a `bool`.

Given a `tristate` value t, the state it represents can be uniquely determined by the following coding pattern:

if (t) {
// t is true
}
else if (!t) {
// t is false
else {
// t is unknown
}

Note
  Inspired by boost::tribool

Definition at line 69 of file tristate.hpp.

## Constructor & Destructor Documentation

## tristate() [1/2]

apache::subversion::svnxx::tristate::tristate | ( | bool | initial_value | ) |

inline constexpr noexcept

Constructor for the true and false states.

Definition at line 94 of file tristate.hpp.

## tristate() [2/2]

apache::subversion::svnxx::tristate::tristate | ( | boost::tribool | t | ) |

inline constexpr noexcept

Conversion from boost::tribool.

Returns
  a `tribool` value equivalent to the t.

Note
  Avalible only if `SVNXX_USE_BOOST` is defined.

Definition at line 153 of file tristate.hpp.

## Member Function Documentation

## operator boost::tribool()

apache::subversion::svnxx::tristate::operator boost::tribool | ( |  | ) | const

inline constexpr noexcept

Conversion to boost::tribool.

Returns
  a boost::tribool value equivalent to the `tristate` value.

Note
  Avalible only if `SVNXX_USE_BOOST` is defined.

Definition at line 164 of file tristate.hpp.

## operator safe_bool()

apache::subversion::svnxx::tristate::operator safe_bool | ( |  | ) | const

inline constexpr noexcept

Safe conversion to `bool`.

Returns
  a true-like value only when this `tristate` is the true state.

Definition at line 103 of file tristate.hpp.

## operator!()

tristate apache::subversion::svnxx::tristate::operator! | ( |  | ) | const

inline constexpr noexcept

Logical negation.

Returns
  the logical negation of a `tristate`, according to the following table:

  `!` |
  --- | ---
  false | true
  true | false
  unknown | unknown

Definition at line 131 of file tristate.hpp.

References unknown().

## unknown()

constexpr tristate apache::subversion::svnxx::tristate::unknown | ( |  | ) |

inline static constexpr noexcept

Factory method for the unknown state.

Definition at line 86 of file tristate.hpp.

Referenced by operator!(), operator!=(), operator&&(), apache::subversion::svnxx::revision::operator<(), operator==(), apache::subversion::svnxx::revision::operator>(), and operator||().

## Friends And Related Symbol Documentation

## operator!=() [1/5]

tristate operator!= | ( | bool | b,
|  | tristate | t )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 470 of file tristate.hpp.

## operator!=() [2/5]

tristate operator!= | ( | boost::tribool | b,
|  | tristate | t )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
  Avalible only if `SVNXX_USE_BOOST` is defined.

Definition at line 491 of file tristate.hpp.

## operator!=() [3/5]

tristate operator!= | ( | tristate | t,
|  | bool | b )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 461 of file tristate.hpp.

## operator!=() [4/5]

tristate operator!= | ( | tristate | t,
|  | boost::tribool | b )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
  Avalible only if `SVNXX_USE_BOOST` is defined.

Definition at line 481 of file tristate.hpp.

## operator!=() [5/5]

tristate operator!= | ( | tristate | t,
|  | tristate | u )

related

Inquality comparison.

Returns
  the result of comparing two `tristate` values for inequality, according to the following table:

  `!=` | false | true | unknown
  --- | --- | --- | ---
  false | false | true | unknown
  true | true | false | unknown
  unknown | unknown | unknown | unknown

Definition at line 451 of file tristate.hpp.

References unknown().

## operator&&() [1/5]

tristate operator&& | ( | bool | b,
|  | tristate | t )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 235 of file tristate.hpp.

## operator&&() [2/5]

tristate operator&& | ( | boost::tribool | b,
|  | tristate | t )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
  Avalible only if `SVNXX_USE_BOOST` is defined.

Definition at line 256 of file tristate.hpp.

## operator&&() [3/5]

tristate operator&& | ( | tristate | t,
|  | bool | b )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 226 of file tristate.hpp.

## operator&&() [4/5]

tristate operator&& | ( | tristate | t,
|  | boost::tribool | b )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
  Avalible only if `SVNXX_USE_BOOST` is defined.

Definition at line 246 of file tristate.hpp.

## operator&&() [5/5]

tristate operator&& | ( | tristate | t,
|  | tristate | u )

related

Logical conjunction.

Returns
  the result of a logical `AND` of two `tristate` values, according to the following table:

  `&&` | false | true | unknown
  --- | --- | --- | ---
  false | false | false | false
  true | false | true | unknown
  unknown | false | unknown | unknown

Definition at line 215 of file tristate.hpp.

References unknown().

## operator==() [1/5]

tristate operator== | ( | bool | b,
|  | tristate | t )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 392 of file tristate.hpp.

## operator==() [2/5]

tristate operator== | ( | boost::tribool | b,
|  | tristate | t )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
  Avalible only if `SVNXX_USE_BOOST` is defined.

Definition at line 413 of file tristate.hpp.

## operator==() [3/5]

tristate operator== | ( | tristate | t,
|  | bool | b )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 383 of file tristate.hpp.

## operator==() [4/5]

tristate operator== | ( | tristate | t,
|  | boost::tribool | b )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
  Avalible only if `SVNXX_USE_BOOST` is defined.

Definition at line 403 of file tristate.hpp.

## operator==() [5/5]

tristate operator== | ( | tristate | t,
|  | tristate | u )

related

Equality comparison.

Returns
  the result of comparing two `tristate` values for equality, according to the following table:

  `==` | false | true | unknown
  --- | --- | --- | ---
  false | true | false | unknown
  true | false | true | unknown
  unknown | unknown | unknown | unknown

Definition at line 373 of file tristate.hpp.

References unknown().

## operator||() [1/5]

tristate operator|| | ( | bool | b,
|  | tristate | t )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 314 of file tristate.hpp.

## operator||() [2/5]

tristate operator|| | ( | boost::tribool | b,
|  | tristate | t )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
  Avalible only if `SVNXX_USE_BOOST` is defined.

Definition at line 335 of file tristate.hpp.

## operator||() [3/5]

tristate operator|| | ( | tristate | t,
|  | bool | b )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 305 of file tristate.hpp.

## operator||() [4/5]

tristate operator|| | ( | tristate | t,
|  | boost::tribool | b )

related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
  Avalible only if `SVNXX_USE_BOOST` is defined.

Definition at line 325 of file tristate.hpp.

## operator||() [5/5]

tristate operator|| | ( | tristate | t,
|  | tristate | u )

related

Logical disjunction.

Returns
  the result of a logical `OR` of two `tristate` values, according to the following table:

  `||` | false | true | unknown
  --- | --- | --- | ---
  false | false | true | unknown
  true | true | true | true
  unknown | unknown | true | unknown

Definition at line 294 of file tristate.hpp.

References unknown().

## unknown()

bool unknown | ( | tristate | t | ) |

related

Test for the unknown `tristate` state.

Returns
  `true` only if t is the unknown state.

Definition at line 178 of file tristate.hpp.

The documentation for this class was generated from the following file:

- svnxx/tristate.hpp