staticlib_support  1.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
staticlib::support::logic::tribool Class Reference

A 3-state boolean type. More...

#include <staticlib/support/tribool.hpp>

Classes

struct  dummy
 INTERNAL ONLY.

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

Public Attributes

enum
staticlib::support::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

staticlib::support::logic::tribool::tribool ( )
inline

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

Exceptions
nothrow
staticlib::support::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
staticlib::support::logic::tribool::tribool ( indeterminate_keyword_t  )
inline

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

Exceptions
nothrow

Member Function Documentation

staticlib::support::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

Member Data Documentation

enum staticlib::support::logic::tribool::value_t staticlib::support::logic::tribool::value

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