From 5c10ee451700b023902a12db81b39804cb8a8b9f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 8 Aug 2018 00:27:59 +0300 Subject: [PATCH] explicit_operator_bool: fix g++ 4.6 workaround --- include/boost/core/explicit_operator_bool.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/boost/core/explicit_operator_bool.hpp b/include/boost/core/explicit_operator_bool.hpp index 4660d6a..d689f11 100644 --- a/include/boost/core/explicit_operator_bool.hpp +++ b/include/boost/core/explicit_operator_bool.hpp @@ -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()\