From ade77d330900a6d30b458202ef082de9a8a8664a Mon Sep 17 00:00:00 2001 From: Nick Thompson <4nt@ornl.gov> Date: Thu, 25 Feb 2021 09:29:49 -0500 Subject: [PATCH] CXX03 workaround removal. --- .../math/cstdfloat/cstdfloat_complex_std.hpp | 16 ----------- .../math/distributions/hyperexponential.hpp | 6 +--- include/boost/math/quaternion.hpp | 2 -- .../detail/bernoulli_details.hpp | 9 ------ .../special_functions/hypergeometric_1F1.hpp | 28 +++++-------------- .../special_functions/hypergeometric_pFq.hpp | 6 +--- .../math/special_functions/lambert_w.hpp | 15 ++-------- .../boost/math/special_functions/legendre.hpp | 8 +----- 8 files changed, 13 insertions(+), 77 deletions(-) diff --git a/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp b/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp index 495ad88b60..8e2e3f06cf 100644 --- a/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp +++ b/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp @@ -90,21 +90,6 @@ complex(const complex&); complex(const complex&); - #if defined(BOOST_NO_CXX11_CONSTEXPR) - complex(const value_type& r = value_type(), - const value_type& i = value_type()) : re(r), - im(i) { } - - template - explicit complex(const complex& x) : re(x.real()), - im(x.imag()) { } - - const value_type& real() const { return re; } - const value_type& imag() const { return im; } - - value_type& real() { return re; } - value_type& imag() { return im; } - #else BOOST_CONSTEXPR complex(const value_type& r = value_type(), const value_type& i = value_type()) : re(r), im(i) { } @@ -115,7 +100,6 @@ value_type real() const { return re; } value_type imag() const { return im; } - #endif void real(value_type r) { re = r; } void imag(value_type i) { im = i; } diff --git a/include/boost/math/distributions/hyperexponential.hpp b/include/boost/math/distributions/hyperexponential.hpp index b0c504e9c7..89202246cd 100644 --- a/include/boost/math/distributions/hyperexponential.hpp +++ b/include/boost/math/distributions/hyperexponential.hpp @@ -35,10 +35,8 @@ #include #include #include +#include -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) -# include -#endif #ifdef _MSC_VER # pragma warning (push) @@ -320,7 +318,6 @@ class hyperexponential_distribution PolicyT()); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) // Initializer list constructor: allows for construction from array literals: public: hyperexponential_distribution(std::initializer_list l1, std::initializer_list l2) : probs_(l1.begin(), l1.end()), @@ -349,7 +346,6 @@ public: hyperexponential_distribution(std::initializer_list l1) &err, PolicyT()); } -#endif // !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) // Single argument constructor: argument must be a range. public: template diff --git a/include/boost/math/quaternion.hpp b/include/boost/math/quaternion.hpp index 7c4e6409c3..6c27ccdf67 100644 --- a/include/boost/math/quaternion.hpp +++ b/include/boost/math/quaternion.hpp @@ -116,13 +116,11 @@ namespace boost b(a_recopier.R_component_2()), c(a_recopier.R_component_3()), d(a_recopier.R_component_4()) {} -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES BOOST_CONSTEXPR quaternion(quaternion && a_recopier) : a(std::move(a_recopier.R_component_1())), b(std::move(a_recopier.R_component_2())), c(std::move(a_recopier.R_component_3())), d(std::move(a_recopier.R_component_4())) {} -#endif // templated copy constructor diff --git a/include/boost/math/special_functions/detail/bernoulli_details.hpp b/include/boost/math/special_functions/detail/bernoulli_details.hpp index 36af71418d..a62d4686c3 100644 --- a/include/boost/math/special_functions/detail/bernoulli_details.hpp +++ b/include/boost/math/special_functions/detail/bernoulli_details.hpp @@ -201,18 +201,9 @@ struct fixed_vector : private std::allocator } ~fixed_vector() { -#ifdef BOOST_NO_CXX11_ALLOCATOR for(unsigned i = 0; i < m_used; ++i) this->destroy(&m_data[i]); this->deallocate(m_data, m_capacity); -#else - typedef std::allocator allocator_type; - typedef std::allocator_traits allocator_traits; - allocator_type& alloc = *this; - for(unsigned i = 0; i < m_used; ++i) - allocator_traits::destroy(alloc, &m_data[i]); - allocator_traits::deallocate(alloc, m_data, m_capacity); -#endif } T& operator[](unsigned n) { BOOST_ASSERT(n < m_used); return m_data[n]; } const T& operator[](unsigned n)const { BOOST_ASSERT(n < m_used); return m_data[n]; } diff --git a/include/boost/math/special_functions/hypergeometric_1F1.hpp b/include/boost/math/special_functions/hypergeometric_1F1.hpp index d15f46c5c4..d54df974a6 100644 --- a/include/boost/math/special_functions/hypergeometric_1F1.hpp +++ b/include/boost/math/special_functions/hypergeometric_1F1.hpp @@ -11,11 +11,7 @@ #define BOOST_MATH_HYPERGEOMETRIC_1F1_HPP #include - -#if defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) || defined(BOOST_NO_CXX11_LAMBDAS) || defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) -# error "hypergeometric_1F1 requires a C++11 compiler" -#endif - +#include #include #include #include @@ -590,14 +586,8 @@ namespace boost { namespace math { namespace detail { // // Actual result will be result * e^log_scaling. // -#ifndef BOOST_NO_CXX11_THREAD_LOCAL - static const thread_local long long max_scaling = lltrunc(boost::math::tools::log_max_value()) - 2; - static const thread_local T max_scale_factor = exp(T(max_scaling)); -#else - long long max_scaling = lltrunc(boost::math::tools::log_max_value()) - 2; - T max_scale_factor = exp(T(max_scaling)); -#endif - + static const thread_local long long max_scaling = lltrunc(boost::math::tools::log_max_value()) - 2; + static const thread_local T max_scale_factor = exp(T(max_scaling)); while (log_scaling > max_scaling) { result *= max_scale_factor; @@ -634,15 +624,11 @@ namespace boost { namespace math { namespace detail { // // Actual result will be result * e^log_scaling / tgamma(b). // - int result_sign = 1; - T scale = log_scaling - boost::math::lgamma(b, &result_sign, pol); -#ifndef BOOST_NO_CXX11_THREAD_LOCAL + int result_sign = 1; + T scale = log_scaling - boost::math::lgamma(b, &result_sign, pol); + static const thread_local T max_scaling = boost::math::tools::log_max_value() - 2; - static const thread_local T max_scale_factor = exp(max_scaling); -#else - T max_scaling = boost::math::tools::log_max_value() - 2; - T max_scale_factor = exp(max_scaling); -#endif + static const thread_local T max_scale_factor = exp(max_scaling); while (scale > max_scaling) { diff --git a/include/boost/math/special_functions/hypergeometric_pFq.hpp b/include/boost/math/special_functions/hypergeometric_pFq.hpp index 520765eca6..c4697ff7fc 100644 --- a/include/boost/math/special_functions/hypergeometric_pFq.hpp +++ b/include/boost/math/special_functions/hypergeometric_pFq.hpp @@ -9,11 +9,7 @@ #define BOOST_MATH_HYPERGEOMETRIC_PFQ_HPP #include - -#if defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) || defined(BOOST_NO_CXX11_LAMBDAS) || defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) || defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) || defined(BOOST_NO_CXX11_HDR_CHRONO) -# error "hypergeometric_pFq requires a C++11 compiler" -#endif - +#include #include #include #include diff --git a/include/boost/math/special_functions/lambert_w.hpp b/include/boost/math/special_functions/lambert_w.hpp index 09ebbcc903..907140bb2e 100644 --- a/include/boost/math/special_functions/lambert_w.hpp +++ b/include/boost/math/special_functions/lambert_w.hpp @@ -55,8 +55,7 @@ BOOST_MATH_INSTRUMENT_LAMBERT_W_SMALL_Z_SERIES_ITERATIONS // Show evaluation of #include // for log (1 + x) #include // For exp_minus_one == 3.67879441171442321595523770161460867e-01. #include // powers with compile time exponent, used in arbitrary precision code. -#include // series functor. -//#include // polynomial. +#include // series functor #include // evaluate_polynomial. #include #include // boost::math::tools::max_value(). @@ -510,20 +509,12 @@ T lambert_w0_small_z(T x, const Policy&, std::integral_constant const&); template T lambert_w0_small_z(T x, const Policy& pol) { //std::numeric_limits::max_digits10 == 36 ? 3 : // 128-bit long double. - using tag_type = std::integral_constant::is_specialized == 0 ? 5 : -#ifndef BOOST_NO_CXX11_NUMERIC_LIMITS + using tag_type = std::integral_constant::is_specialized == 0 ? 5 : std::numeric_limits::max_digits10 <= 9 ? 0 : // for float 32-bit. std::numeric_limits::max_digits10 <= 17 ? 1 : // for double 64-bit. std::numeric_limits::max_digits10 <= 22 ? 2 : // for 80-bit double extended. std::numeric_limits::max_digits10 < 37 ? 4 // for both 128-bit long double (3) and 128-bit quad suffix Q type (4). -#else - std::numeric_limits::radix != 2 ? 5 : - std::numeric_limits::digits <= 24 ? 0 : // for float 32-bit. - std::numeric_limits::digits <= 53 ? 1 : // for double 64-bit. - std::numeric_limits::digits <= 64 ? 2 : // for 80-bit double extended. - std::numeric_limits::digits <= 113 ? 4 // for both 128-bit long double (3) and 128-bit quad suffix Q type (4). -#endif : 5>; // All Generic multiprecision types. // std::cout << "\ntag type = " << tag_type << std::endl; // error C2275: 'tag_type': illegal use of this type as an expression. return lambert_w0_small_z(x, pol, tag_type()); diff --git a/include/boost/math/special_functions/legendre.hpp b/include/boost/math/special_functions/legendre.hpp index 78c003c754..ee5af5f80f 100644 --- a/include/boost/math/special_functions/legendre.hpp +++ b/include/boost/math/special_functions/legendre.hpp @@ -73,13 +73,7 @@ T legendre_imp(unsigned l, T x, const Policy& pol, bool second = false) } template -T legendre_p_prime_imp(unsigned l, T x, const Policy& pol, T* Pn -#ifdef BOOST_NO_CXX11_NULLPTR - = 0 -#else - = nullptr -#endif -) +T legendre_p_prime_imp(unsigned l, T x, const Policy& pol, T* Pn = nullptr) { static const char* function = "boost::math::legrendre_p_prime<%1%>(unsigned, %1%)"; // Error handling: