forked from boostorg/logic
Use explicit operator bool when available
This commit is contained in:
committed by
James E. King III
parent
bffcf0c4db
commit
23cd89d4c8
@ -109,11 +109,22 @@ public:
|
||||
* \returns true if the 3-state boolean is true, false otherwise
|
||||
* \throws nothrow
|
||||
*/
|
||||
#if !defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS )
|
||||
|
||||
BOOST_CONSTEXPR explicit operator bool () const BOOST_NOEXCEPT
|
||||
{
|
||||
return value == true_value;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
BOOST_CONSTEXPR operator safe_bool() const BOOST_NOEXCEPT
|
||||
{
|
||||
return value == true_value? &dummy::nonnull : 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The actual stored value in this 3-state boolean, which may be false, true,
|
||||
* or indeterminate.
|
||||
|
Reference in New Issue
Block a user