Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class tribool

boost::logic::tribool — A 3-state boolean type.

Synopsis

// In header: <boost/logic/tribool.hpp>


class tribool {
public:
  enum value_t;
  // construct/copy/destruct
  () ;
  (bool) ;
  () ;

  // public member functions
  BOOST_CONSTEXPR () ;

  // public data members
  enum  value;
};

Description

3-state boolean values are either true, false, or indeterminate.

tribool public construct/copy/destruct

  1. () ;

    Construct a new 3-state boolean value with the value 'false'.

    Throws:

    Will not throw.
  2. (bool initial_value) ;

    Construct a new 3-state boolean value with the given boolean value, which may be true or false.

    Throws:

    Will not throw.
  3. () ;

    Construct a new 3-state boolean value with an indeterminate value.

    Throws:

    Will not throw.

tribool public member functions

  1. BOOST_CONSTEXPR () ;

    Use a 3-state boolean in a boolean context. Will evaluate true in a boolean context only when the 3-state boolean is definitely true.

    Returns:

    true if the 3-state boolean is true, false otherwise

    Throws:

    Will not throw.

PrevUpHomeNext