mirror of
https://github.com/boostorg/core.git
synced 2025-07-29 20:37:22 +02:00
explicit_operator_bool: under g++ 4.6 the operator can't be constexpr
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#define BOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
@ -121,12 +122,20 @@ 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()\
|
||||
|
Reference in New Issue
Block a user