Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions include/boost/logic/tribool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ indeterminate(tribool x,
*/
class tribool
{
#if defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS )
private:
#if defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS )
/// INTERNAL ONLY
struct dummy {
void nonnull() {};
Expand All @@ -81,6 +81,12 @@ class tribool
typedef void (dummy::*safe_bool)();
#endif

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

public:
/**
* Construct a new 3-state boolean value with the value 'false'.
Expand Down Expand Up @@ -126,12 +132,8 @@ class tribool
}

#endif

/**
* The actual stored value in this 3-state boolean, which may be false, true,
* or indeterminate.
*/
enum value_t { false_value, true_value, indeterminate_value } value;
friend BOOST_CONSTEXPR inline bool indeterminate(tribool x, detail::indeterminate_t) BOOST_NOEXCEPT;
friend BOOST_CONSTEXPR inline tribool operator!(tribool x) BOOST_NOEXCEPT;
};

// Check if the given tribool has an indeterminate value. Also doubles as a
Expand Down Expand Up @@ -463,7 +465,7 @@ inline bool \
Name(boost::logic::tribool x, \
boost::logic::detail::indeterminate_t = \
boost::logic::detail::indeterminate_t()) \
{ return x.value == boost::logic::tribool::indeterminate_value; }
{ return boost::logic::indeterminate(x); }

#endif // BOOST_LOGIC_TRIBOOL_HPP