Skip to content

Make the code compile with C++17 #96

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion PolyARules.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class PolyARules {
case 1 : return 0;
case 2 : iter = exceptionList.find(transcript_id);
return (iter == exceptionList.end() ? polyALen : 0);
default : assert(false);
default : abort();
}
}

Expand Down
29 changes: 12 additions & 17 deletions boost/math/special_functions/detail/lanczos_sse2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ inline double lanczos13m53::lanczos_sum<double>(const double& x)
static_cast<double>(23531376880.41075968857200767445163675473L),
static_cast<double>(0u)
};
register __m128d vx = _mm_load1_pd(&x);
register __m128d sum_even = _mm_load_pd(coeff);
register __m128d sum_odd = _mm_load_pd(coeff+2);
register __m128d nc_odd, nc_even;
register __m128d vx2 = _mm_mul_pd(vx, vx);
__m128d vx = _mm_load1_pd(&x);
__m128d sum_even = _mm_load_pd(coeff);
__m128d sum_odd = _mm_load_pd(coeff+2);
__m128d nc_odd, nc_even;
__m128d vx2 = _mm_mul_pd(vx, vx);

sum_even = _mm_mul_pd(sum_even, vx2);
nc_even = _mm_load_pd(coeff + 4);
Expand Down Expand Up @@ -101,7 +101,7 @@ inline double lanczos13m53::lanczos_sum<double>(const double& x)

double ALIGN16 t[2];
_mm_store_pd(t, sum_even);

return t[0] / t[1];
}

Expand Down Expand Up @@ -136,11 +136,11 @@ inline double lanczos13m53::lanczos_sum_expG_scaled<double>(const double& x)
static_cast<double>(56906521.91347156388090791033559122686859L),
static_cast<double>(0u)
};
register __m128d vx = _mm_load1_pd(&x);
register __m128d sum_even = _mm_load_pd(coeff);
register __m128d sum_odd = _mm_load_pd(coeff+2);
register __m128d nc_odd, nc_even;
register __m128d vx2 = _mm_mul_pd(vx, vx);
__m128d vx = _mm_load1_pd(&x);
__m128d sum_even = _mm_load_pd(coeff);
__m128d sum_odd = _mm_load_pd(coeff+2);
__m128d nc_odd, nc_even;
__m128d vx2 = _mm_mul_pd(vx, vx);

sum_even = _mm_mul_pd(sum_even, vx2);
nc_even = _mm_load_pd(coeff + 4);
Expand Down Expand Up @@ -186,7 +186,7 @@ inline double lanczos13m53::lanczos_sum_expG_scaled<double>(const double& x)

double ALIGN16 t[2];
_mm_store_pd(t, sum_even);

return t[0] / t[1];
}

Expand All @@ -197,8 +197,3 @@ inline double lanczos13m53::lanczos_sum_expG_scaled<double>(const double& x)
#undef ALIGN16

#endif // BOOST_MATH_SPECIAL_FUNCTIONS_LANCZOS





8 changes: 4 additions & 4 deletions boost/random/uniform_on_sphere.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace random {
* numbers uniformly distributed on the unit sphere of arbitrary
* dimension @c dim. The @c Cont template parameter must be a STL-like
* container type with begin and end operations returning non-const
* ForwardIterators of type @c Cont::iterator.
* ForwardIterators of type @c Cont::iterator.
*/
template<class RealType = double, class Cont = std::vector<RealType> >
class uniform_on_sphere
Expand Down Expand Up @@ -170,9 +170,9 @@ class uniform_on_sphere
sqsum += val * val;
}
using std::sqrt;
// for all i: result[i] /= sqrt(sqsum)
std::transform(_container.begin(), _container.end(), _container.begin(),
std::bind2nd(std::divides<RealType>(), sqrt(sqsum)));
for (auto& it : _container) {
*it /= sqrt(sqsum);
}
return _container;
}

Expand Down
8 changes: 4 additions & 4 deletions boost/smart_ptr/detail/shared_count.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <boost/detail/workaround.hpp>
// In order to avoid circular dependencies with Boost.TR1
// we make sure that our include of <memory> doesn't try to
// pull in the TR1 headers: that's why we use this header
// pull in the TR1 headers: that's why we use this header
// rather than including <memory> directly:
#include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
#include <functional> // std::less
Expand Down Expand Up @@ -66,7 +66,7 @@ template< class D > struct sp_inplace_tag
#if !defined( BOOST_NO_CXX11_SMART_PTR )

template< class T > class sp_reference_wrapper
{
{
public:

explicit sp_reference_wrapper( T & t): t_( boost::addressof( t ) )
Expand Down Expand Up @@ -320,7 +320,7 @@ class shared_count
// auto_ptr<Y> is special cased to provide the strong guarantee

template<class Y>
explicit shared_count( std::auto_ptr<Y> & r ): pi_( new sp_counted_impl_p<Y>( r.get() ) )
explicit shared_count( std::unique_ptr<Y> & r ): pi_( new sp_counted_impl_p<Y>( r.get() ) )
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(shared_count_id)
#endif
Expand All @@ -337,7 +337,7 @@ class shared_count
r.release();
}

#endif
#endif

#if !defined( BOOST_NO_CXX11_SMART_PTR )

Expand Down
24 changes: 12 additions & 12 deletions boost/smart_ptr/shared_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// In order to avoid circular dependencies with Boost.TR1
// we make sure that our include of <memory> doesn't try to
// pull in the TR1 headers: that's why we use this header
// pull in the TR1 headers: that's why we use this header
// rather than including <memory> directly:
#include <boost/config/no_tr1/memory.hpp> // std::auto_ptr

Expand Down Expand Up @@ -244,10 +244,10 @@ template< class T, class R > struct sp_enable_if_auto_ptr
{
};

template< class T, class R > struct sp_enable_if_auto_ptr< std::auto_ptr< T >, R >
template< class T, class R > struct sp_enable_if_auto_ptr< std::unique_ptr< T >, R >
{
typedef R type;
};
};

#endif

Expand Down Expand Up @@ -443,7 +443,7 @@ template<class T> class shared_ptr
#ifndef BOOST_NO_AUTO_PTR

template<class Y>
explicit shared_ptr( std::auto_ptr<Y> & r ): px(r.get()), pn()
explicit shared_ptr( std::unique_ptr<Y> & r ): px(r.get()), pn()
{
boost::detail::sp_assert_convertible< Y, T >();

Expand All @@ -456,7 +456,7 @@ template<class T> class shared_ptr
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )

template<class Y>
shared_ptr( std::auto_ptr<Y> && r ): px(r.get()), pn()
shared_ptr( std::unique_ptr<Y> && r ): px(r.get()), pn()
{
boost::detail::sp_assert_convertible< Y, T >();

Expand Down Expand Up @@ -522,7 +522,7 @@ template<class T> class shared_ptr
#ifndef BOOST_NO_AUTO_PTR

template<class Y>
shared_ptr & operator=( std::auto_ptr<Y> & r )
shared_ptr & operator=( std::unique_ptr<Y> & r )
{
this_type( r ).swap( *this );
return *this;
Expand All @@ -531,9 +531,9 @@ template<class T> class shared_ptr
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )

template<class Y>
shared_ptr & operator=( std::auto_ptr<Y> && r )
shared_ptr & operator=( std::unique_ptr<Y> && r )
{
this_type( static_cast< std::auto_ptr<Y> && >( r ) ).swap( *this );
this_type( static_cast< std::unique_ptr<Y> && >( r ) ).swap( *this );
return *this;
}

Expand Down Expand Up @@ -639,21 +639,21 @@ template<class T> class shared_ptr
{
this_type( r, p ).swap( *this );
}

// never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT)
typename boost::detail::sp_dereference< T >::type operator* () const
{
BOOST_ASSERT( px != 0 );
return *px;
}

// never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT)
typename boost::detail::sp_member_access< T >::type operator-> () const
typename boost::detail::sp_member_access< T >::type operator-> () const
{
BOOST_ASSERT( px != 0 );
return px;
}

// never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT)
typename boost::detail::sp_array_access< T >::type operator[] ( std::ptrdiff_t i ) const
{
Expand Down