From 989bc6bf1131d7a644db0378eda88bcb65f5a261 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Tue, 16 Feb 2021 10:59:49 +0300 Subject: [PATCH] Assume no BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS [ci skip] --- include/boost/math/policies/policy.hpp | 61 +------------------------- 1 file changed, 1 insertion(+), 60 deletions(-) diff --git a/include/boost/math/policies/policy.hpp b/include/boost/math/policies/policy.hpp index 05f8c1bb2..8175fb5ed 100644 --- a/include/boost/math/policies/policy.hpp +++ b/include/boost/math/policies/policy.hpp @@ -739,55 +739,6 @@ struct evaluation using type = typename std::conditional::type; }; -#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS - -template -struct basic_digits : public std::integral_constant{ }; -template <> -struct basic_digits : public std::integral_constant::digits>{ }; -template <> -struct basic_digits : public std::integral_constant::digits>{ }; -template <> -struct basic_digits : public std::integral_constant::digits>{ }; - -template -struct precision -{ - static_assert(std::numeric_limits::radix == 2, "std::numeric_limits::radix == 2"); - using precision_type = typename Policy::precision_type; - using digits_t = basic_digits; - using type = typename std::conditional< - (digits_t::value == 0), - // Possibly unknown precision: - precision_type, - typename std::conditional< - (digits_t::value <= precision_type || precision_type::value <= 0), - // Default case, full precision for RealType: - digits2< std::numeric_limits::digits>, - // User customised precision: - precision_type - >::type - >::type; -}; - -template -struct precision -{ - using type = digits2::digits>; -}; -template -struct precision -{ - using type = digits2::digits>; -}; -template -struct precision -{ - using type = digits2::digits>; -}; - -#else - template struct precision { @@ -827,8 +778,6 @@ struct precision #endif }; -#endif - #ifdef BOOST_MATH_USE_FLOAT128 template @@ -844,11 +793,7 @@ namespace detail{ template inline constexpr int digits_imp(std::true_type const&) noexcept { -#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS static_assert( std::numeric_limits::is_specialized, "std::numeric_limits::is_specialized"); -#else - assert(std::numeric_limits::is_specialized); -#endif typedef typename boost::math::policies::precision::type p_t; return p_t::value; } @@ -926,13 +871,9 @@ struct series_factor_calc template inline constexpr T get_epsilon_imp(std::true_type const&) noexcept(std::is_floating_point::value) { -#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS static_assert(std::numeric_limits::is_specialized, "std::numeric_limits::is_specialized"); static_assert(std::numeric_limits::radix == 2, "std::numeric_limits::radix == 2"); -#else - assert(std::numeric_limits::is_specialized); - assert(std::numeric_limits::radix == 2); -#endif + typedef typename boost::math::policies::precision::type p_t; typedef std::integral_constant::digits> is_small_int; typedef std::integral_constant= std::numeric_limits::digits> is_default_value;