1
0
forked from boostorg/core

explicit_operator_bool: fix g++ 4.6 workaround

This commit is contained in:
Peter Dimov
2018-08-08 00:27:59 +03:00
parent b7ad896707
commit 5c10ee4517

View File

@ -53,6 +53,8 @@
return !this->operator! ();\
}
#if !BOOST_WORKAROUND(BOOST_GCC, < 40700)
/*!
* \brief The macro defines a constexpr explicit operator of conversion to \c bool
*
@ -66,6 +68,12 @@
return !this->operator! ();\
}
#else
#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL() BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
#endif
#else // !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
#if (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) && !defined(BOOST_NO_COMPILER_CONFIG)
@ -122,20 +130,12 @@ namespace detail {
return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
}
#if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL() BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
#else
#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\
BOOST_FORCEINLINE BOOST_CONSTEXPR operator boost::detail::unspecified_bool_type () const BOOST_NOEXCEPT\
{\
return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
}
#endif
#else // !defined(BOOST_NO_UNSPECIFIED_BOOL)
#define BOOST_EXPLICIT_OPERATOR_BOOL()\