diff options
Diffstat (limited to 'boost/multiprecision/detail/number_base.hpp')
-rw-r--r-- | boost/multiprecision/detail/number_base.hpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/boost/multiprecision/detail/number_base.hpp b/boost/multiprecision/detail/number_base.hpp index 09c86e6ce0..d725779091 100644 --- a/boost/multiprecision/detail/number_base.hpp +++ b/boost/multiprecision/detail/number_base.hpp @@ -25,7 +25,19 @@ # define BOOST_MP_FORCEINLINE inline #endif -namespace boost{ namespace multiprecision{ +#if defined(BOOST_GCC) && (BOOST_GCC <= 40700) +# define BOOST_MP_NOEXCEPT_IF(x) +#else +# define BOOST_MP_NOEXCEPT_IF(x) BOOST_NOEXCEPT_IF(x) +#endif + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable:6326) +#endif + +namespace boost{ + namespace multiprecision{ enum expression_template_option { @@ -72,13 +84,13 @@ struct is_compatible_arithmetic_type namespace detail{ // -// Workaround for missing abs(long long) and abs(__int128) on some compilers: +// Workaround for missing abs(boost::long_long_type) and abs(__int128) on some compilers: // template <class T> BOOST_CONSTEXPR typename enable_if_c<(is_signed<T>::value || is_floating_point<T>::value), T>::type abs(T t) BOOST_NOEXCEPT { // This strange expression avoids a hardware trap in the corner case - // that val is the most negative value permitted in long long. + // that val is the most negative value permitted in boost::long_long_type. // See https://svn.boost.org/trac/boost/ticket/9740. return t < 0 ? T(1u) + T(-(t + 1)) : t; } @@ -94,7 +106,7 @@ template <class T> BOOST_CONSTEXPR typename enable_if_c<(is_signed<T>::value || is_floating_point<T>::value), typename make_unsigned<T>::type>::type unsigned_abs(T t) BOOST_NOEXCEPT { // This strange expression avoids a hardware trap in the corner case - // that val is the most negative value permitted in long long. + // that val is the most negative value permitted in boost::long_long_type. // See https://svn.boost.org/trac/boost/ticket/9740. return t < 0 ? static_cast<typename make_unsigned<T>::type>(1u) + static_cast<typename make_unsigned<T>::type>(-(t + 1)) : static_cast<typename make_unsigned<T>::type>(t); } @@ -814,6 +826,10 @@ namespace constants{ }} +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + #endif // BOOST_MATH_BIG_NUM_BASE_HPP |