From a80edc889cb866c6ec1857a76401f10efcd35c6e Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 25 Mar 2021 20:50:13 +0300 Subject: [PATCH] special_fun now passes in standalone mode --- .../boost/math/differentiation/autodiff.hpp | 2 +- .../boost/math/policies/error_handling.hpp | 48 +++++++++---------- .../special_functions/detail/fp_traits.hpp | 4 +- .../detail/hypergeometric_1F1_large_abz.hpp | 2 +- .../math/special_functions/fpclassify.hpp | 32 ++++++------- .../boost/math/special_functions/math_fwd.hpp | 16 ++----- include/boost/math/special_functions/modf.hpp | 6 +-- .../boost/math/special_functions/round.hpp | 16 +++---- include/boost/math/special_functions/sign.hpp | 16 +++---- .../boost/math/special_functions/trunc.hpp | 26 ++++------ include/boost/math/tools/config.hpp | 14 ++++++ .../boost/math/tools/convert_from_string.hpp | 2 +- include/boost/math/tools/fraction.hpp | 16 +++---- include/boost/math/tools/minima.hpp | 4 +- include/boost/math/tools/real_cast.hpp | 2 +- include/boost/math/tools/roots.hpp | 36 +++++++------- include/boost/math/tr1.hpp | 33 ++++++------- test/compile_test/instantiate.hpp | 13 +++++ 18 files changed, 143 insertions(+), 145 deletions(-) diff --git a/include/boost/math/differentiation/autodiff.hpp b/include/boost/math/differentiation/autodiff.hpp index 02d1e6e18..39e561cbf 100644 --- a/include/boost/math/differentiation/autodiff.hpp +++ b/include/boost/math/differentiation/autodiff.hpp @@ -2029,7 +2029,7 @@ struct promote_args_2> template inline constexpr destination_t real_cast(detail::autodiff_fvar_type const& from_v) - BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(destination_t) && BOOST_MATH_IS_FLOAT(RealType)) { + noexcept(BOOST_MATH_IS_FLOAT(destination_t) && BOOST_MATH_IS_FLOAT(RealType)) { return real_cast(static_cast>(from_v)); } diff --git a/include/boost/math/policies/error_handling.hpp b/include/boost/math/policies/error_handling.hpp index c8585753c..4ee6877e2 100644 --- a/include/boost/math/policies/error_handling.hpp +++ b/include/boost/math/policies/error_handling.hpp @@ -610,7 +610,7 @@ inline T raise_indeterminate_result_error( } // namespace detail template -inline constexpr T raise_domain_error(const char* function, const char* message, const T& val, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) +inline constexpr T raise_domain_error(const char* function, const char* message, const T& val, const Policy&) noexcept(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) { typedef typename Policy::domain_error_type policy_type; return detail::raise_domain_error( @@ -619,7 +619,7 @@ inline constexpr T raise_domain_error(const char* function, const char* message, } template -inline constexpr T raise_pole_error(const char* function, const char* message, const T& val, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) +inline constexpr T raise_pole_error(const char* function, const char* message, const T& val, const Policy&) noexcept(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) { typedef typename Policy::pole_error_type policy_type; return detail::raise_pole_error( @@ -628,7 +628,7 @@ inline constexpr T raise_pole_error(const char* function, const char* message, c } template -inline constexpr T raise_overflow_error(const char* function, const char* message, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) +inline constexpr T raise_overflow_error(const char* function, const char* message, const Policy&) noexcept(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) { typedef typename Policy::overflow_error_type policy_type; return detail::raise_overflow_error( @@ -637,7 +637,7 @@ inline constexpr T raise_overflow_error(const char* function, const char* messag } template -inline constexpr T raise_overflow_error(const char* function, const char* message, const T& val, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) +inline constexpr T raise_overflow_error(const char* function, const char* message, const T& val, const Policy&) noexcept(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) { typedef typename Policy::overflow_error_type policy_type; return detail::raise_overflow_error( @@ -646,7 +646,7 @@ inline constexpr T raise_overflow_error(const char* function, const char* messag } template -inline constexpr T raise_underflow_error(const char* function, const char* message, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) +inline constexpr T raise_underflow_error(const char* function, const char* message, const Policy&) noexcept(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) { typedef typename Policy::underflow_error_type policy_type; return detail::raise_underflow_error( @@ -655,7 +655,7 @@ inline constexpr T raise_underflow_error(const char* function, const char* messa } template -inline constexpr T raise_denorm_error(const char* function, const char* message, const T& val, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) +inline constexpr T raise_denorm_error(const char* function, const char* message, const T& val, const Policy&) noexcept(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) { typedef typename Policy::denorm_error_type policy_type; return detail::raise_denorm_error( @@ -665,7 +665,7 @@ inline constexpr T raise_denorm_error(const char* function, const char* message, } template -inline constexpr T raise_evaluation_error(const char* function, const char* message, const T& val, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) +inline constexpr T raise_evaluation_error(const char* function, const char* message, const T& val, const Policy&) noexcept(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) { typedef typename Policy::evaluation_error_type policy_type; return detail::raise_evaluation_error( @@ -674,7 +674,7 @@ inline constexpr T raise_evaluation_error(const char* function, const char* mess } template -inline constexpr TargetType raise_rounding_error(const char* function, const char* message, const T& val, const TargetType& t, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) +inline constexpr TargetType raise_rounding_error(const char* function, const char* message, const T& val, const TargetType& t, const Policy&) noexcept(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) { typedef typename Policy::rounding_error_type policy_type; return detail::raise_rounding_error( @@ -683,7 +683,7 @@ inline constexpr TargetType raise_rounding_error(const char* function, const cha } template -inline constexpr T raise_indeterminate_result_error(const char* function, const char* message, const T& val, const R& result, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) +inline constexpr T raise_indeterminate_result_error(const char* function, const char* message, const T& val, const R& result, const Policy&) noexcept(is_noexcept_error_policy::value && BOOST_MATH_IS_FLOAT(T)) { typedef typename Policy::indeterminate_result_error_type policy_type; return detail::raise_indeterminate_result_error( @@ -698,7 +698,7 @@ namespace detail { template -inline bool check_overflow(T val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) +inline bool check_overflow(T val, R* result, const char* function, const Policy& pol) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) { BOOST_MATH_STD_USING if(fabs(val) > tools::max_value()) @@ -710,7 +710,7 @@ inline bool check_overflow(T val, R* result, const char* function, const Policy& return false; } template -inline bool check_overflow(std::complex val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) +inline bool check_overflow(std::complex val, R* result, const char* function, const Policy& pol) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) { typedef typename R::value_type r_type; r_type re, im; @@ -720,7 +720,7 @@ inline bool check_overflow(std::complex val, R* result, const char* function, return r; } template -inline bool check_underflow(T val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) +inline bool check_underflow(T val, R* result, const char* function, const Policy& pol) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) { if((val != 0) && (static_cast(val) == 0)) { @@ -730,7 +730,7 @@ inline bool check_underflow(T val, R* result, const char* function, const Policy return false; } template -inline bool check_underflow(std::complex val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) +inline bool check_underflow(std::complex val, R* result, const char* function, const Policy& pol) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) { typedef typename R::value_type r_type; r_type re, im; @@ -740,7 +740,7 @@ inline bool check_underflow(std::complex val, R* result, const char* function return r; } template -inline bool check_denorm(T val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) +inline bool check_denorm(T val, R* result, const char* function, const Policy& pol) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) { BOOST_MATH_STD_USING if((fabs(val) < static_cast(tools::min_value())) && (static_cast(val) != 0)) @@ -751,7 +751,7 @@ inline bool check_denorm(T val, R* result, const char* function, const Policy& p return false; } template -inline bool check_denorm(std::complex val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) +inline bool check_denorm(std::complex val, R* result, const char* function, const Policy& pol) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error)) { typedef typename R::value_type r_type; r_type re, im; @@ -763,28 +763,28 @@ inline bool check_denorm(std::complex val, R* result, const char* function, c // Default instantiations with ignore_error policy. template -inline constexpr bool check_overflow(T /* val */, R* /* result */, const char* /* function */, const overflow_error&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) +inline constexpr bool check_overflow(T /* val */, R* /* result */, const char* /* function */, const overflow_error&) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) { return false; } template -inline constexpr bool check_overflow(std::complex /* val */, R* /* result */, const char* /* function */, const overflow_error&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) +inline constexpr bool check_overflow(std::complex /* val */, R* /* result */, const char* /* function */, const overflow_error&) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) { return false; } template -inline constexpr bool check_underflow(T /* val */, R* /* result */, const char* /* function */, const underflow_error&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) +inline constexpr bool check_underflow(T /* val */, R* /* result */, const char* /* function */, const underflow_error&) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) { return false; } template -inline constexpr bool check_underflow(std::complex /* val */, R* /* result */, const char* /* function */, const underflow_error&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) +inline constexpr bool check_underflow(std::complex /* val */, R* /* result */, const char* /* function */, const underflow_error&) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) { return false; } template -inline constexpr bool check_denorm(T /* val */, R* /* result*/, const char* /* function */, const denorm_error&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) +inline constexpr bool check_denorm(T /* val */, R* /* result*/, const char* /* function */, const denorm_error&) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) { return false; } template -inline constexpr bool check_denorm(std::complex /* val */, R* /* result*/, const char* /* function */, const denorm_error&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) +inline constexpr bool check_denorm(std::complex /* val */, R* /* result*/, const char* /* function */, const denorm_error&) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T)) { return false; } } // namespace detail template -inline R checked_narrowing_cast(T val, const char* function) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && is_noexcept_error_policy::value) +inline R checked_narrowing_cast(T val, const char* function) noexcept(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && is_noexcept_error_policy::value) { typedef typename Policy::overflow_error_type overflow_type; typedef typename Policy::underflow_error_type underflow_type; @@ -804,7 +804,7 @@ inline R checked_narrowing_cast(T val, const char* function) BOOST_NOEXCEPT_IF(B } template -inline void check_series_iterations(const char* function, std::uintmax_t max_iter, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && is_noexcept_error_policy::value) +inline void check_series_iterations(const char* function, std::uintmax_t max_iter, const Policy& pol) noexcept(BOOST_MATH_IS_FLOAT(T) && is_noexcept_error_policy::value) { if(max_iter >= policies::get_max_series_iterations()) raise_evaluation_error( @@ -813,7 +813,7 @@ inline void check_series_iterations(const char* function, std::uintmax_t max_ite } template -inline void check_root_iterations(const char* function, std::uintmax_t max_iter, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && is_noexcept_error_policy::value) +inline void check_root_iterations(const char* function, std::uintmax_t max_iter, const Policy& pol) noexcept(BOOST_MATH_IS_FLOAT(T) && is_noexcept_error_policy::value) { if(max_iter >= policies::get_max_root_iterations()) raise_evaluation_error( diff --git a/include/boost/math/special_functions/detail/fp_traits.hpp b/include/boost/math/special_functions/detail/fp_traits.hpp index 2eb67215a..420724097 100644 --- a/include/boost/math/special_functions/detail/fp_traits.hpp +++ b/include/boost/math/special_functions/detail/fp_traits.hpp @@ -545,7 +545,7 @@ template<> struct size_to_precision<16, true> template struct select_native { - typedef BOOST_DEDUCED_TYPENAME size_to_precision::value>::type precision; + typedef typename size_to_precision::value>::type precision; typedef fp_traits_non_native type; }; template<> @@ -583,7 +583,7 @@ struct select_native template struct fp_traits { - typedef BOOST_DEDUCED_TYPENAME size_to_precision::value>::type precision; + typedef typename size_to_precision::value>::type precision; #if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY) typedef typename select_native::type type; #else diff --git a/include/boost/math/special_functions/detail/hypergeometric_1F1_large_abz.hpp b/include/boost/math/special_functions/detail/hypergeometric_1F1_large_abz.hpp index 7823e33cb..6345095f8 100644 --- a/include/boost/math/special_functions/detail/hypergeometric_1F1_large_abz.hpp +++ b/include/boost/math/special_functions/detail/hypergeometric_1F1_large_abz.hpp @@ -11,7 +11,7 @@ #include #include #include - +#include namespace boost { namespace math { namespace detail { diff --git a/include/boost/math/special_functions/fpclassify.hpp b/include/boost/math/special_functions/fpclassify.hpp index 019596f8a..ad75bc8d1 100644 --- a/include/boost/math/special_functions/fpclassify.hpp +++ b/include/boost/math/special_functions/fpclassify.hpp @@ -210,11 +210,11 @@ inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T t, const generic_tag&) template int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_all_bits_tag) { - typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + typedef typename fp_traits::type traits; BOOST_MATH_INSTRUMENT_VARIABLE(x); - BOOST_DEDUCED_TYPENAME traits::bits a; + typename traits::bits a; traits::get_bits(x,a); BOOST_MATH_INSTRUMENT_VARIABLE(a); a &= traits::exponent | traits::flag | traits::significand; @@ -239,11 +239,11 @@ int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_all_bits_tag) template int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_leading_bits_tag) { - typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + typedef typename fp_traits::type traits; BOOST_MATH_INSTRUMENT_VARIABLE(x); - BOOST_DEDUCED_TYPENAME traits::bits a; + typename traits::bits a; traits::get_bits(x,a); a &= traits::exponent | traits::flag | traits::significand; @@ -335,8 +335,8 @@ namespace detail { template inline bool isfinite_impl(T x, ieee_tag const&) { - typedef BOOST_DEDUCED_TYPENAME detail::fp_traits::type traits; - BOOST_DEDUCED_TYPENAME traits::bits a; + typedef typename detail::fp_traits::type traits; + typename traits::bits a; traits::get_bits(x,a); a &= traits::exponent; return a != traits::exponent; @@ -406,8 +406,8 @@ namespace detail { template inline bool isnormal_impl(T x, ieee_tag const&) { - typedef BOOST_DEDUCED_TYPENAME detail::fp_traits::type traits; - BOOST_DEDUCED_TYPENAME traits::bits a; + typedef typename detail::fp_traits::type traits; + typename traits::bits a; traits::get_bits(x,a); a &= traits::exponent | traits::flag; return (a != 0) && (a < traits::exponent); @@ -479,9 +479,9 @@ namespace detail { template inline bool isinf_impl(T x, ieee_copy_all_bits_tag const&) { - typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + typedef typename fp_traits::type traits; - BOOST_DEDUCED_TYPENAME traits::bits a; + typename traits::bits a; traits::get_bits(x,a); a &= traits::exponent | traits::significand; return a == traits::exponent; @@ -490,9 +490,9 @@ namespace detail { template inline bool isinf_impl(T x, ieee_copy_leading_bits_tag const&) { - typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + typedef typename fp_traits::type traits; - BOOST_DEDUCED_TYPENAME traits::bits a; + typename traits::bits a; traits::get_bits(x,a); a &= traits::exponent | traits::significand; if(a != traits::exponent) @@ -574,9 +574,9 @@ namespace detail { template inline bool isnan_impl(T x, ieee_copy_all_bits_tag const&) { - typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + typedef typename fp_traits::type traits; - BOOST_DEDUCED_TYPENAME traits::bits a; + typename traits::bits a; traits::get_bits(x,a); a &= traits::exponent | traits::significand; return a > traits::exponent; @@ -585,9 +585,9 @@ namespace detail { template inline bool isnan_impl(T x, ieee_copy_leading_bits_tag const&) { - typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + typedef typename fp_traits::type traits; - BOOST_DEDUCED_TYPENAME traits::bits a; + typename traits::bits a; traits::get_bits(x,a); a &= traits::exponent | traits::significand; diff --git a/include/boost/math/special_functions/math_fwd.hpp b/include/boost/math/special_functions/math_fwd.hpp index 40c557102..6f9d739e1 100644 --- a/include/boost/math/special_functions/math_fwd.hpp +++ b/include/boost/math/special_functions/math_fwd.hpp @@ -1188,32 +1188,22 @@ namespace boost } // namespace math } // namespace boost -#ifdef BOOST_HAS_LONG_LONG #define BOOST_MATH_DETAIL_LL_FUNC(Policy)\ \ template \ - inline T modf(const T& v, boost::long_long_type* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\ + inline T modf(const T& v, long long* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\ \ template \ - inline boost::long_long_type lltrunc(const T& v){ using boost::math::lltrunc; return lltrunc(v, Policy()); }\ + inline long long lltrunc(const T& v){ using boost::math::lltrunc; return lltrunc(v, Policy()); }\ \ template \ - inline boost::long_long_type llround(const T& v){ using boost::math::llround; return llround(v, Policy()); }\ + inline long long llround(const T& v){ using boost::math::llround; return llround(v, Policy()); }\ -#else -#define BOOST_MATH_DETAIL_LL_FUNC(Policy) -#endif - -#if !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && !defined(BOOST_NO_CXX11_HDR_ARRAY) # define BOOST_MATH_DETAIL_11_FUNC(Policy)\ template \ inline typename boost::math::tools::promote_args::type hypergeometric_1F1(const T& a, const U& b, const V& z)\ { return boost::math::hypergeometric_1F1(a, b, z, Policy()); }\ -#else -# define BOOST_MATH_DETAIL_11_FUNC(Policy) -#endif - #define BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS(Policy)\ \ BOOST_MATH_DETAIL_LL_FUNC(Policy)\ diff --git a/include/boost/math/special_functions/modf.hpp b/include/boost/math/special_functions/modf.hpp index 3ce74e7aa..75e6be9f4 100644 --- a/include/boost/math/special_functions/modf.hpp +++ b/include/boost/math/special_functions/modf.hpp @@ -52,19 +52,17 @@ inline T modf(const T& v, long* ipart) return modf(v, ipart, policies::policy<>()); } -#ifdef BOOST_HAS_LONG_LONG template -inline T modf(const T& v, boost::long_long_type* ipart, const Policy& pol) +inline T modf(const T& v, long long* ipart, const Policy& pol) { *ipart = lltrunc(v, pol); return v - *ipart; } template -inline T modf(const T& v, boost::long_long_type* ipart) +inline T modf(const T& v, long long* ipart) { return modf(v, ipart, policies::policy<>()); } -#endif }} // namespaces diff --git a/include/boost/math/special_functions/round.hpp b/include/boost/math/special_functions/round.hpp index ed7c7a24e..7e23e159f 100644 --- a/include/boost/math/special_functions/round.hpp +++ b/include/boost/math/special_functions/round.hpp @@ -114,29 +114,25 @@ inline long lround(const T& v) return lround(v, policies::policy<>()); } -#ifdef BOOST_HAS_LONG_LONG - template -inline boost::long_long_type llround(const T& v, const Policy& pol) +inline long long llround(const T& v, const Policy& pol) { BOOST_MATH_STD_USING typedef typename tools::promote_args::type result_type; T r = boost::math::round(v, pol); - if(r > static_cast((std::numeric_limits::max)()) || - r < static_cast((std::numeric_limits::min)())) + if(r > static_cast((std::numeric_limits::max)()) || + r < static_cast((std::numeric_limits::min)())) { - return static_cast(policies::raise_rounding_error("boost::math::llround<%1%>(%1%)", 0, v, static_cast(0), pol)); + return static_cast(policies::raise_rounding_error("boost::math::llround<%1%>(%1%)", 0, v, static_cast(0), pol)); } - return static_cast(r); + return static_cast(r); } template -inline boost::long_long_type llround(const T& v) +inline long long llround(const T& v) { return llround(v, policies::policy<>()); } -#endif - }} // namespaces #endif // BOOST_MATH_ROUND_HPP diff --git a/include/boost/math/special_functions/sign.hpp b/include/boost/math/special_functions/sign.hpp index 5cb21bac5..8f9fc4793 100644 --- a/include/boost/math/special_functions/sign.hpp +++ b/include/boost/math/special_functions/sign.hpp @@ -67,9 +67,9 @@ namespace detail { template inline int signbit_impl(T x, ieee_copy_all_bits_tag const&) { - typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + typedef typename fp_traits::type traits; - BOOST_DEDUCED_TYPENAME traits::bits a; + typename traits::bits a; traits::get_bits(x,a); return a & traits::sign ? 1 : 0; } @@ -77,9 +77,9 @@ namespace detail { template inline int signbit_impl(T x, ieee_copy_leading_bits_tag const&) { - typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + typedef typename fp_traits::type traits; - BOOST_DEDUCED_TYPENAME traits::bits a; + typename traits::bits a; traits::get_bits(x,a); return a & traits::sign ? 1 : 0; @@ -126,9 +126,9 @@ namespace detail { template inline T changesign_impl(T x, ieee_copy_all_bits_tag const&) { - typedef BOOST_DEDUCED_TYPENAME fp_traits::sign_change_type traits; + typedef typename fp_traits::sign_change_type traits; - BOOST_DEDUCED_TYPENAME traits::bits a; + typename traits::bits a; traits::get_bits(x,a); a ^= traits::sign; traits::set_bits(x,a); @@ -138,9 +138,9 @@ namespace detail { template inline T (changesign_impl)(T x, ieee_copy_leading_bits_tag const&) { - typedef BOOST_DEDUCED_TYPENAME fp_traits::sign_change_type traits; + typedef typename fp_traits::sign_change_type traits; - BOOST_DEDUCED_TYPENAME traits::bits a; + typename traits::bits a; traits::get_bits(x,a); a ^= traits::sign; traits::set_bits(x,a); diff --git a/include/boost/math/special_functions/trunc.hpp b/include/boost/math/special_functions/trunc.hpp index b6c39af85..46a2a991f 100644 --- a/include/boost/math/special_functions/trunc.hpp +++ b/include/boost/math/special_functions/trunc.hpp @@ -91,29 +91,25 @@ inline long ltrunc(const T& v) return ltrunc(v, policies::policy<>()); } -#ifdef BOOST_HAS_LONG_LONG - template -inline boost::long_long_type lltrunc(const T& v, const Policy& pol) +inline long long lltrunc(const T& v, const Policy& pol) { BOOST_MATH_STD_USING typedef typename tools::promote_args::type result_type; result_type r = boost::math::trunc(v, pol); - if(r > static_cast((std::numeric_limits::max)()) || - r < static_cast((std::numeric_limits::min)())) + if(r > static_cast((std::numeric_limits::max)()) || + r < static_cast((std::numeric_limits::min)())) { - return static_cast(policies::raise_rounding_error("boost::math::lltrunc<%1%>(%1%)", 0, v, static_cast(0), pol)); + return static_cast(policies::raise_rounding_error("boost::math::lltrunc<%1%>(%1%)", 0, v, static_cast(0), pol)); } - return static_cast(r); + return static_cast(r); } template -inline boost::long_long_type lltrunc(const T& v) +inline long long lltrunc(const T& v) { return lltrunc(v, policies::policy<>()); } -#endif - template inline typename std::enable_if::value, int>::type iconvert(const T& v, const Policy&) @@ -144,25 +140,21 @@ inline typename std::enable_if::value, long>::ty return ltrunc(v, pol); } -#ifdef BOOST_HAS_LONG_LONG - template -inline typename std::enable_if::value, boost::long_long_type>::type +inline typename std::enable_if::value, long long>::type llconvertert(const T& v, const Policy&) { - return static_cast(v); + return static_cast(v); } template -inline typename std::enable_if::value, boost::long_long_type>::type +inline typename std::enable_if::value, long long>::type llconvertert(const T& v, const Policy& pol) { using boost::math::lltrunc; return lltrunc(v, pol); } -#endif - }} // namespaces #endif // BOOST_MATH_TRUNC_HPP diff --git a/include/boost/math/tools/config.hpp b/include/boost/math/tools/config.hpp index 72254dd07..ac637474c 100644 --- a/include/boost/math/tools/config.hpp +++ b/include/boost/math/tools/config.hpp @@ -10,10 +10,22 @@ #pragma once #endif +#define BOOST_MATH_STANDALONE #ifndef BOOST_MATH_STANDALONE #include #else // Things from boost/config that are required, and easy to replicate + #define BOOST_PREVENT_MACRO_SUBSTITUTION +#define BOOST_MATH_NO_REAL_CONCEPT_TESTS +#define BOOST_MATH_NO_DISTRIBUTION_CONCEPT_TESTS + +#if (__cplusplus > 201400L || _MSVC_LANG > 201400L) +#define BOOST_CXX14_CONSTEXPR constexpr +#else +#define BOOST_CXX14_CONSTEXPR +#define BOOST_NO_CXX14_CONSTEXPR +#endif // BOOST_CXX14_CONSTEXPR + #endif // BOOST_MATH_STANDALONE #include // for min and max @@ -38,7 +50,9 @@ // For reasons I don't understand, the tests with IMB's compiler all // pass at long double precision, but fail with real_concept, those tests // are disabled for now. (JM 2012). +#ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS # define BOOST_MATH_NO_REAL_CONCEPT_TESTS +#endif // BOOST_MATH_NO_REAL_CONCEPT_TESTS #endif #ifdef sun // Any use of __float128 in program startup code causes a segfault (tested JM 2015, Solaris 11). diff --git a/include/boost/math/tools/convert_from_string.hpp b/include/boost/math/tools/convert_from_string.hpp index 01f7669e4..3dbd7f8ed 100644 --- a/include/boost/math/tools/convert_from_string.hpp +++ b/include/boost/math/tools/convert_from_string.hpp @@ -37,7 +37,7 @@ namespace boost{ namespace math{ namespace tools{ return p; } template - constexpr typename convert_from_string_result::type convert_from_string(const char* p) BOOST_NOEXCEPT_IF((std::is_constructible::value)) + constexpr typename convert_from_string_result::type convert_from_string(const char* p) noexcept((std::is_constructible::value)) { return convert_from_string(p, std::is_constructible()); } diff --git a/include/boost/math/tools/fraction.hpp b/include/boost/math/tools/fraction.hpp index 92171e3a9..a64c07025 100644 --- a/include/boost/math/tools/fraction.hpp +++ b/include/boost/math/tools/fraction.hpp @@ -105,7 +105,7 @@ namespace detail // template inline typename detail::fraction_traits::result_type continued_fraction_b(Gen& g, const U& factor, std::uintmax_t& max_terms) - BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) + noexcept(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) { BOOST_MATH_STD_USING // ADL of std names @@ -150,7 +150,7 @@ inline typename detail::fraction_traits::result_type continued_fraction_b(G template inline typename detail::fraction_traits::result_type continued_fraction_b(Gen& g, const U& factor) - BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) + noexcept(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) { std::uintmax_t max_terms = (std::numeric_limits::max)(); return continued_fraction_b(g, factor, max_terms); @@ -158,7 +158,7 @@ inline typename detail::fraction_traits::result_type continued_fraction_b(G template inline typename detail::fraction_traits::result_type continued_fraction_b(Gen& g, int bits) - BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) + noexcept(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) { BOOST_MATH_STD_USING // ADL of std names @@ -172,7 +172,7 @@ inline typename detail::fraction_traits::result_type continued_fraction_b(G template inline typename detail::fraction_traits::result_type continued_fraction_b(Gen& g, int bits, std::uintmax_t& max_terms) - BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) + noexcept(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) { BOOST_MATH_STD_USING // ADL of std names @@ -199,7 +199,7 @@ inline typename detail::fraction_traits::result_type continued_fraction_b(G // template inline typename detail::fraction_traits::result_type continued_fraction_a(Gen& g, const U& factor, std::uintmax_t& max_terms) - BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) + noexcept(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) { BOOST_MATH_STD_USING // ADL of std names @@ -246,7 +246,7 @@ inline typename detail::fraction_traits::result_type continued_fraction_a(G template inline typename detail::fraction_traits::result_type continued_fraction_a(Gen& g, const U& factor) - BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) + noexcept(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) { std::uintmax_t max_iter = (std::numeric_limits::max)(); return continued_fraction_a(g, factor, max_iter); @@ -254,7 +254,7 @@ inline typename detail::fraction_traits::result_type continued_fraction_a(G template inline typename detail::fraction_traits::result_type continued_fraction_a(Gen& g, int bits) - BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) + noexcept(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) { BOOST_MATH_STD_USING // ADL of std names @@ -269,7 +269,7 @@ inline typename detail::fraction_traits::result_type continued_fraction_a(G template inline typename detail::fraction_traits::result_type continued_fraction_a(Gen& g, int bits, std::uintmax_t& max_terms) - BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) + noexcept(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits::result_type) && noexcept(std::declval()())) { BOOST_MATH_STD_USING // ADL of std names diff --git a/include/boost/math/tools/minima.hpp b/include/boost/math/tools/minima.hpp index 800976b96..6070fc530 100644 --- a/include/boost/math/tools/minima.hpp +++ b/include/boost/math/tools/minima.hpp @@ -21,7 +21,7 @@ namespace boost{ namespace math{ namespace tools{ template std::pair brent_find_minima(F f, T min, T max, int bits, std::uintmax_t& max_iter) - BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) + noexcept(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { BOOST_MATH_STD_USING bits = (std::min)(policies::digits >() / 2, bits); @@ -139,7 +139,7 @@ std::pair brent_find_minima(F f, T min, T max, int bits, std::uintmax_t& m template inline std::pair brent_find_minima(F f, T min, T max, int digits) - BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) + noexcept(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { std::uintmax_t m = (std::numeric_limits::max)(); return brent_find_minima(f, min, max, digits, m); diff --git a/include/boost/math/tools/real_cast.hpp b/include/boost/math/tools/real_cast.hpp index 3d2b48a7e..a68738b34 100644 --- a/include/boost/math/tools/real_cast.hpp +++ b/include/boost/math/tools/real_cast.hpp @@ -17,7 +17,7 @@ namespace boost{ namespace math namespace tools { template - inline constexpr To real_cast(T t) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && BOOST_MATH_IS_FLOAT(To)) + inline constexpr To real_cast(T t) noexcept(BOOST_MATH_IS_FLOAT(T) && BOOST_MATH_IS_FLOAT(To)) { return static_cast(t); } diff --git a/include/boost/math/tools/roots.hpp b/include/boost/math/tools/roots.hpp index 6270d00b9..5b06e5bc9 100644 --- a/include/boost/math/tools/roots.hpp +++ b/include/boost/math/tools/roots.hpp @@ -82,7 +82,7 @@ void handle_zero_derivative(F f, T& result, T& guess, const T& min, - const T& max) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) + const T& max) noexcept(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { if (last_f0 == 0) { @@ -128,7 +128,7 @@ void handle_zero_derivative(F f, } // namespace template -std::pair bisect(F f, T min, T max, Tol tol, std::uintmax_t& max_iter, const Policy& pol) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) +std::pair bisect(F f, T min, T max, Tol tol, std::uintmax_t& max_iter, const Policy& pol) noexcept(policies::is_noexcept_error_policy::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { T fmin = f(min); T fmax = f(max); @@ -200,13 +200,13 @@ std::pair bisect(F f, T min, T max, Tol tol, std::uintmax_t& max_iter, con } template -inline std::pair bisect(F f, T min, T max, Tol tol, std::uintmax_t& max_iter) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) +inline std::pair bisect(F f, T min, T max, Tol tol, std::uintmax_t& max_iter) noexcept(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { return bisect(f, min, max, tol, max_iter, policies::policy<>()); } template -inline std::pair bisect(F f, T min, T max, Tol tol) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) +inline std::pair bisect(F f, T min, T max, Tol tol) noexcept(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { std::uintmax_t m = (std::numeric_limits::max)(); return bisect(f, min, max, tol, m, policies::policy<>()); @@ -214,7 +214,7 @@ inline std::pair bisect(F f, T min, T max, Tol tol) BOOST_NOEXCEPT_IF(poli template -T newton_raphson_iterate(F f, T guess, T min, T max, int digits, std::uintmax_t& max_iter) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) +T newton_raphson_iterate(F f, T guess, T min, T max, int digits, std::uintmax_t& max_iter) noexcept(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { BOOST_MATH_STD_USING @@ -333,7 +333,7 @@ T newton_raphson_iterate(F f, T guess, T min, T max, int digits, std::uintmax_t& } template -inline T newton_raphson_iterate(F f, T guess, T min, T max, int digits) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) +inline T newton_raphson_iterate(F f, T guess, T min, T max, int digits) noexcept(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { std::uintmax_t m = (std::numeric_limits::max)(); return newton_raphson_iterate(f, guess, min, max, digits, m); @@ -344,7 +344,7 @@ namespace detail { struct halley_step { template - static T step(const T& /*x*/, const T& f0, const T& f1, const T& f2) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T)) + static T step(const T& /*x*/, const T& f0, const T& f1, const T& f2) noexcept(BOOST_MATH_IS_FLOAT(T)) { using std::fabs; T denom = 2 * f0; @@ -366,10 +366,10 @@ namespace detail { }; template - T bracket_root_towards_min(F f, T guess, const T& f0, T& min, T& max, std::uintmax_t& count) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))); + T bracket_root_towards_min(F f, T guess, const T& f0, T& min, T& max, std::uintmax_t& count) noexcept(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))); template - T bracket_root_towards_max(F f, T guess, const T& f0, T& min, T& max, std::uintmax_t& count) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) + T bracket_root_towards_max(F f, T guess, const T& f0, T& min, T& max, std::uintmax_t& count) noexcept(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { using std::fabs; // @@ -424,7 +424,7 @@ namespace detail { } template - T bracket_root_towards_min(F f, T guess, const T& f0, T& min, T& max, std::uintmax_t& count) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) + T bracket_root_towards_min(F f, T guess, const T& f0, T& min, T& max, std::uintmax_t& count) noexcept(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { using std::fabs; // @@ -480,7 +480,7 @@ namespace detail { } template - T second_order_root_finder(F f, T guess, T min, T max, int digits, std::uintmax_t& max_iter) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) + T second_order_root_finder(F f, T guess, T min, T max, int digits, std::uintmax_t& max_iter) noexcept(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { BOOST_MATH_STD_USING @@ -672,13 +672,13 @@ namespace detail { } // T second_order_root_finder template -T halley_iterate(F f, T guess, T min, T max, int digits, std::uintmax_t& max_iter) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) +T halley_iterate(F f, T guess, T min, T max, int digits, std::uintmax_t& max_iter) noexcept(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { return detail::second_order_root_finder(f, guess, min, max, digits, max_iter); } template -inline T halley_iterate(F f, T guess, T min, T max, int digits) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) +inline T halley_iterate(F f, T guess, T min, T max, int digits) noexcept(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { std::uintmax_t m = (std::numeric_limits::max)(); return halley_iterate(f, guess, min, max, digits, m); @@ -689,7 +689,7 @@ namespace detail { struct schroder_stepper { template - static T step(const T& x, const T& f0, const T& f1, const T& f2) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T)) + static T step(const T& x, const T& f0, const T& f1, const T& f2) noexcept(BOOST_MATH_IS_FLOAT(T)) { using std::fabs; T ratio = f0 / f1; @@ -710,13 +710,13 @@ namespace detail { } template -T schroder_iterate(F f, T guess, T min, T max, int digits, std::uintmax_t& max_iter) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) +T schroder_iterate(F f, T guess, T min, T max, int digits, std::uintmax_t& max_iter) noexcept(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { return detail::second_order_root_finder(f, guess, min, max, digits, max_iter); } template -inline T schroder_iterate(F f, T guess, T min, T max, int digits) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) +inline T schroder_iterate(F f, T guess, T min, T max, int digits) noexcept(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { std::uintmax_t m = (std::numeric_limits::max)(); return schroder_iterate(f, guess, min, max, digits, m); @@ -725,13 +725,13 @@ inline T schroder_iterate(F f, T guess, T min, T max, int digits) BOOST_NOEXCEPT // These two are the old spelling of this function, retained for backwards compatibility just in case: // template -T schroeder_iterate(F f, T guess, T min, T max, int digits, std::uintmax_t& max_iter) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) +T schroeder_iterate(F f, T guess, T min, T max, int digits, std::uintmax_t& max_iter) noexcept(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { return detail::second_order_root_finder(f, guess, min, max, digits, max_iter); } template -inline T schroeder_iterate(F f, T guess, T min, T max, int digits) BOOST_NOEXCEPT_IF(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) +inline T schroeder_iterate(F f, T guess, T min, T max, int digits) noexcept(policies::is_noexcept_error_policy >::value&& BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval()(std::declval()))) { std::uintmax_t m = (std::numeric_limits::max)(); return schroder_iterate(f, guess, min, max, digits, m); diff --git a/include/boost/math/tr1.hpp b/include/boost/math/tr1.hpp index 710e3cae4..01054c992 100644 --- a/include/boost/math/tr1.hpp +++ b/include/boost/math/tr1.hpp @@ -191,16 +191,11 @@ int BOOST_MATH_TR1_DECL boost_ilogbl BOOST_PREVENT_MACRO_SUBSTITUTION(long doubl double BOOST_MATH_TR1_DECL boost_lgamma BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; float BOOST_MATH_TR1_DECL boost_lgammaf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; long double BOOST_MATH_TR1_DECL boost_lgammal BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; -#ifdef BOOST_HAS_LONG_LONG -#if 0 -::boost::long_long_type BOOST_MATH_TR1_DECL boost_llrint BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; -::boost::long_long_type BOOST_MATH_TR1_DECL boost_llrintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; -::boost::long_long_type BOOST_MATH_TR1_DECL boost_llrintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; -#endif -::boost::long_long_type BOOST_MATH_TR1_DECL boost_llround BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; -::boost::long_long_type BOOST_MATH_TR1_DECL boost_llroundf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; -::boost::long_long_type BOOST_MATH_TR1_DECL boost_llroundl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; -#endif + +long long BOOST_MATH_TR1_DECL boost_llround BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +long long BOOST_MATH_TR1_DECL boost_llroundf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long long BOOST_MATH_TR1_DECL boost_llroundl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; + double BOOST_MATH_TR1_DECL boost_log1p BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; float BOOST_MATH_TR1_DECL boost_log1pf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; long double BOOST_MATH_TR1_DECL boost_log1pl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; @@ -586,23 +581,23 @@ inline typename tools::promote_args::type lgamma BOOST_PREVENT_MACRO_SUBSTITU #ifdef BOOST_HAS_LONG_LONG #if 0 -::boost::long_long_type llrint BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -::boost::long_long_type llrintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -::boost::long_long_type llrintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +long long llrint BOOST_PREVENT_MACRO_SUBSTITUTION(double x); +long long llrintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); +long long llrintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); #endif -inline ::boost::long_long_type llroundf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) +inline long long llroundf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) { return boost::math::tr1::boost_llroundf BOOST_PREVENT_MACRO_SUBSTITUTION(x); } -inline ::boost::long_long_type llround BOOST_PREVENT_MACRO_SUBSTITUTION(double x) +inline long long llround BOOST_PREVENT_MACRO_SUBSTITUTION(double x) { return boost::math::tr1::boost_llround BOOST_PREVENT_MACRO_SUBSTITUTION(x); } -inline ::boost::long_long_type llroundl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) +inline long long llroundl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) { return boost::math::tr1::boost_llroundl BOOST_PREVENT_MACRO_SUBSTITUTION(x); } -inline ::boost::long_long_type llround BOOST_PREVENT_MACRO_SUBSTITUTION(float x) +inline long long llround BOOST_PREVENT_MACRO_SUBSTITUTION(float x) { return boost::math::tr1::llroundf BOOST_PREVENT_MACRO_SUBSTITUTION(x); } -inline ::boost::long_long_type llround BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) +inline long long llround BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) { return boost::math::tr1::llroundl BOOST_PREVENT_MACRO_SUBSTITUTION(x); } template -inline ::boost::long_long_type llround BOOST_PREVENT_MACRO_SUBSTITUTION(T x) +inline long long llround BOOST_PREVENT_MACRO_SUBSTITUTION(T x) { return llround BOOST_PREVENT_MACRO_SUBSTITUTION(static_cast(x)); } #endif diff --git a/test/compile_test/instantiate.hpp b/test/compile_test/instantiate.hpp index 621b35600..136dbc4a6 100644 --- a/test/compile_test/instantiate.hpp +++ b/test/compile_test/instantiate.hpp @@ -11,6 +11,10 @@ # define BOOST_MATH_ASSERT_UNDEFINED_POLICY false #endif +#include + +#ifndef BOOST_MATH_NO_DISTRIBUTION_CONCEPT_TESTS + #include #include @@ -1559,5 +1563,14 @@ void instantiate_mixed(RealType) #endif } +#else // Standalone mode + +template +void instantiate(T) {} + +template +void instantiate_mixed(T) {} + +#endif // Standalone mode #endif // BOOST_LIBS_MATH_TEST_INSTANTIATE_HPP