Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::logic::tribool Class Reference

A 3-state boolean type. More...

#include <tribool.hpp>

Public Types

enum  value_t {
  false_value,
  true_value,
  indeterminate_value
}
 The actual stored value in this 3-state boolean, which may be false, true, or indeterminate. More...
 

Public Member Functions

 tribool ()
 Construct a new 3-state boolean value with the value 'false'. More...
 
 tribool (bool initial_value)
 Construct a new 3-state boolean value with the given boolean value, which may be true or false. More...
 
 tribool (indeterminate_keyword_t)
 Construct a new 3-state boolean value with an indeterminate value. More...
 
 operator safe_bool () const
 Use a 3-state boolean in a boolean context. More...
 

Public Attributes

enum boost::logic::tribool::value_t value
 

Detailed Description

A 3-state boolean type.

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

Member Enumeration Documentation

The actual stored value in this 3-state boolean, which may be false, true, or indeterminate.

Enumerator
false_value 
true_value 
indeterminate_value 

Constructor & Destructor Documentation

boost::logic::tribool::tribool ( )
inline

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

Exceptions
nothrow
boost::logic::tribool::tribool ( bool  initial_value)
inline

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

Exceptions
nothrow
boost::logic::tribool::tribool ( indeterminate_keyword_t  )
inline

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

Exceptions
nothrow

Member Function Documentation

boost::logic::tribool::operator safe_bool ( ) const
inline

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
Exceptions
nothrow

References true_value, and value.

Member Data Documentation


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