diff --git a/include/boost/logic/tribool.hpp b/include/boost/logic/tribool.hpp index 041c59ce..e1217c52 100644 --- a/include/boost/logic/tribool.hpp +++ b/include/boost/logic/tribool.hpp @@ -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() {}; @@ -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'. @@ -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 @@ -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