Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CXX03 workaround removal. #556

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions include/boost/math/cstdfloat/cstdfloat_complex_std.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,6 @@
complex(const complex<double>&);
complex(const complex<long double>&);

#if defined(BOOST_NO_CXX11_CONSTEXPR)
complex(const value_type& r = value_type(),
const value_type& i = value_type()) : re(r),
im(i) { }

template<typename X>
explicit complex(const complex<X>& 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) { }
Expand All @@ -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; }
Expand Down
6 changes: 1 addition & 5 deletions include/boost/math/distributions/hyperexponential.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@
#include <numeric>
#include <utility>
#include <vector>
#include <initializer_list>

#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
# include <initializer_list>
#endif

#ifdef _MSC_VER
# pragma warning (push)
Expand Down Expand Up @@ -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<RealT> l1, std::initializer_list<RealT> l2)
: probs_(l1.begin(), l1.end()),
Expand Down Expand Up @@ -349,7 +346,6 @@ public: hyperexponential_distribution(std::initializer_list<RealT> l1)
&err,
PolicyT());
}
#endif // !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)

// Single argument constructor: argument must be a range.
public: template <typename RateRangeT>
Expand Down
2 changes: 0 additions & 2 deletions include/boost/math/quaternion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,9 @@ struct fixed_vector : private std::allocator<T>
}
~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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you've deleted the wrong branch here?

This will break C++17 as well I believe.

typedef std::allocator<T> allocator_type;
typedef std::allocator_traits<allocator_type> 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]; }
Expand Down
28 changes: 7 additions & 21 deletions include/boost/math/special_functions/hypergeometric_1F1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
#define BOOST_MATH_HYPERGEOMETRIC_1F1_HPP

#include <boost/config.hpp>

#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 <boost/math/tools/cxx03_warn.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/special_functions/detail/hypergeometric_series.hpp>
Expand Down Expand Up @@ -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<T>()) - 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<T>()) - 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<T>()) - 2;
static const thread_local T max_scale_factor = exp(T(max_scaling));
while (log_scaling > max_scaling)
{
result *= max_scale_factor;
Expand Down Expand Up @@ -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<T>() - 2;
static const thread_local T max_scale_factor = exp(max_scaling);
#else
T max_scaling = boost::math::tools::log_max_value<T>() - 2;
T max_scale_factor = exp(max_scaling);
#endif
static const thread_local T max_scale_factor = exp(max_scaling);

while (scale > max_scaling)
{
Expand Down
6 changes: 1 addition & 5 deletions include/boost/math/special_functions/hypergeometric_pFq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
#define BOOST_MATH_HYPERGEOMETRIC_PFQ_HPP

#include <boost/config.hpp>

#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 <boost/math/tools/cxx03_warn.hpp>
#include <boost/math/special_functions/detail/hypergeometric_pFq_checked_series.hpp>
#include <chrono>
#include <initializer_list>
Expand Down
15 changes: 3 additions & 12 deletions include/boost/math/special_functions/lambert_w.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ BOOST_MATH_INSTRUMENT_LAMBERT_W_SMALL_Z_SERIES_ITERATIONS // Show evaluation of
#include <boost/math/special_functions/log1p.hpp> // for log (1 + x)
#include <boost/math/constants/constants.hpp> // For exp_minus_one == 3.67879441171442321595523770161460867e-01.
#include <boost/math/special_functions/pow.hpp> // powers with compile time exponent, used in arbitrary precision code.
#include <boost/math/tools/series.hpp> // series functor.
//#include <boost/math/tools/polynomial.hpp> // polynomial.
#include <boost/math/tools/series.hpp> // series functor
#include <boost/math/tools/rational.hpp> // evaluate_polynomial.
#include <boost/type_traits/is_integral.hpp>
#include <boost/math/tools/precision.hpp> // boost::math::tools::max_value().
Expand Down Expand Up @@ -510,20 +509,12 @@ T lambert_w0_small_z(T x, const Policy&, std::integral_constant<int, 5> const&);
template <typename T, typename Policy>
T lambert_w0_small_z(T x, const Policy& pol)
{ //std::numeric_limits<T>::max_digits10 == 36 ? 3 : // 128-bit long double.
using tag_type = std::integral_constant<int,
std::numeric_limits<T>::is_specialized == 0 ? 5 :
#ifndef BOOST_NO_CXX11_NUMERIC_LIMITS
using tag_type = std::integral_constant<int,
std::numeric_limits<T>::is_specialized == 0 ? 5 :
std::numeric_limits<T>::max_digits10 <= 9 ? 0 : // for float 32-bit.
std::numeric_limits<T>::max_digits10 <= 17 ? 1 : // for double 64-bit.
std::numeric_limits<T>::max_digits10 <= 22 ? 2 : // for 80-bit double extended.
std::numeric_limits<T>::max_digits10 < 37 ? 4 // for both 128-bit long double (3) and 128-bit quad suffix Q type (4).
#else
std::numeric_limits<T>::radix != 2 ? 5 :
std::numeric_limits<T>::digits <= 24 ? 0 : // for float 32-bit.
std::numeric_limits<T>::digits <= 53 ? 1 : // for double 64-bit.
std::numeric_limits<T>::digits <= 64 ? 2 : // for 80-bit double extended.
std::numeric_limits<T>::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());
Expand Down
8 changes: 1 addition & 7 deletions include/boost/math/special_functions/legendre.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,7 @@ T legendre_imp(unsigned l, T x, const Policy& pol, bool second = false)
}

template <class T, class Policy>
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:
Expand Down