diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c9440a3..fd2899cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,6 @@ target_include_directories(boost_numeric_odeint INTERFACE include) target_link_libraries(boost_numeric_odeint INTERFACE Boost::assert - Boost::bind Boost::compute Boost::config Boost::core diff --git a/examples/stepper_details.cpp b/examples/stepper_details.cpp index 05d3404c..0368f8b4 100644 --- a/examples/stepper_details.cpp +++ b/examples/stepper_details.cpp @@ -15,7 +15,6 @@ #include #include -#include #include using namespace std; @@ -130,7 +129,7 @@ int main( int argc , char **argv ) //[ symplectic_stepper_detail_system_class_example harm_osc h; - rkn.do_step( make_pair( boost::bind( &harm_osc::f1 , h , _1 , _2 ) , boost::bind( &harm_osc::f2 , h , _1 , _2 ) ) , + rkn.do_step( make_pair( detail::bind( &harm_osc::f1 , h , _1 , _2 ) , detail::bind( &harm_osc::f2 , h , _1 , _2 ) ) , x , t , dt ); //] } diff --git a/include/boost/numeric/odeint/config.hpp b/include/boost/numeric/odeint/config.hpp index f1915825..964bb1bd 100644 --- a/include/boost/numeric/odeint/config.hpp +++ b/include/boost/numeric/odeint/config.hpp @@ -43,7 +43,7 @@ #include -#if __cplusplus >= 201103L +#if __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) #define BOOST_NUMERIC_ODEINT_CXX11 1 #endif diff --git a/include/boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp b/include/boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp index a3f03507..5efecc41 100644 --- a/include/boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp +++ b/include/boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp @@ -75,8 +75,7 @@ public: deriv_func_type &deriv_func = sys.first; jacobi_func_type &jacobi_func = sys.second; - m_resizer.adjust_size( x , detail::bind( - &stepper_type::template resize_impl< state_type > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); m_identity.m_v = 1; diff --git a/include/boost/numeric/odeint/stepper/adams_bashforth.hpp b/include/boost/numeric/odeint/stepper/adams_bashforth.hpp index 6190dc75..40cd6df1 100644 --- a/include/boost/numeric/odeint/stepper/adams_bashforth.hpp +++ b/include/boost/numeric/odeint/stepper/adams_bashforth.hpp @@ -23,7 +23,6 @@ #include -#include #include #include @@ -194,7 +193,7 @@ public : typename odeint::unwrap_reference< ExplicitStepper >::type &stepper = explicit_stepper; typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_impl , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); for( size_t i=0 ; i+1 void initialize( System system , StateIn &x , time_type &t , time_type dt ) { - initialize( detail::ref( m_initializing_stepper ) , system , x , t , dt ); + initialize( std::ref( m_initializing_stepper ) , system , x , t , dt ); } void reset( void ) @@ -233,7 +232,7 @@ private: void do_step_impl( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) { typename odeint::unwrap_reference< System >::type &sys = system; - if( m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl , detail::ref( *this ) , detail::_1 ) ) ) + if( m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); } ) ) { m_steps_initialized = 0; } diff --git a/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp b/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp index d3d89aec..79998494 100644 --- a/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp +++ b/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp @@ -163,7 +163,7 @@ private: { if( m_adams_bashforth.is_initialized() ) { - m_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); m_adams_bashforth.do_step( system , x , t , m_x.m_v , dt ); m_adams_moulton.do_step( system , x , m_x.m_v , t+dt , x , dt , m_adams_bashforth.step_storage() ); } @@ -178,7 +178,7 @@ private: { if( m_adams_bashforth.is_initialized() ) { - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); m_adams_bashforth.do_step( system , in , t , m_x.m_v , dt ); m_adams_moulton.do_step( system , in , m_x.m_v , t+dt , out , dt , m_adams_bashforth.step_storage() ); } diff --git a/include/boost/numeric/odeint/stepper/adams_moulton.hpp b/include/boost/numeric/odeint/stepper/adams_moulton.hpp index 05b42777..1bde5b0f 100644 --- a/include/boost/numeric/odeint/stepper/adams_moulton.hpp +++ b/include/boost/numeric/odeint/stepper/adams_moulton.hpp @@ -166,7 +166,7 @@ private: void do_step_impl( System system , const StateIn &in , const PredIn &pred , time_type t , StateOut &out , time_type dt , const ABBuf &buf ) { typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); sys( pred , m_dxdt.m_v , t ); detail::adams_moulton_call_algebra< steps , algebra_type , operations_type >()( m_algebra , in , out , m_dxdt.m_v , buf , m_coefficients , dt ); } diff --git a/include/boost/numeric/odeint/stepper/adaptive_adams_bashforth_moulton.hpp b/include/boost/numeric/odeint/stepper/adaptive_adams_bashforth_moulton.hpp index 0d3d0c12..e1ebba5b 100644 --- a/include/boost/numeric/odeint/stepper/adaptive_adams_bashforth_moulton.hpp +++ b/include/boost/numeric/odeint/stepper/adaptive_adams_bashforth_moulton.hpp @@ -86,7 +86,7 @@ public: template< class System > void do_step(System system, state_type &inOut, time_type t, time_type dt ) { - m_xnew_resizer.adjust_size( inOut , detail::bind( &stepper_type::template resize_xnew_impl< state_type > , detail::ref( *this ) , detail::_1 ) ); + m_xnew_resizer.adjust_size(inOut, [this](auto&& arg) { return this->resize_xnew_impl(std::forward(arg)); }); do_step(system, inOut, t, m_xnew.m_v, dt, m_xerr.m_v); boost::numeric::odeint::copy( m_xnew.m_v , inOut); @@ -101,7 +101,7 @@ public: template< class System > void do_step(System system, state_type &inOut, time_type t, time_type dt, state_type &xerr) { - m_xnew_resizer.adjust_size( inOut , detail::bind( &stepper_type::template resize_xnew_impl< state_type > , detail::ref( *this ) , detail::_1 ) ); + m_xnew_resizer.adjust_size(inOut, [this](auto&& arg) { return this->resize_xnew_impl(std::forward(arg)); }); do_step(system, inOut, t, m_xnew.m_v, dt, xerr); boost::numeric::odeint::copy( m_xnew.m_v , inOut); @@ -128,7 +128,7 @@ public: reset(); dt = dt/static_cast< time_type >(order_value); - m_dxdt_resizer.adjust_size( inOut , detail::bind( &stepper_type::template resize_dxdt_impl< state_type > , detail::ref( *this ) , detail::_1 ) ); + m_dxdt_resizer.adjust_size(inOut, [this](auto&& arg) { return this->resize_dxdt_impl(std::forward(arg)); }); system( inOut , m_dxdt.m_v , t ); for( size_t i=0 ; i , detail::ref( *this ) , detail::_1 ) ); - m_dxdt_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_dxdt_impl< state_type > , detail::ref( *this ) , detail::_1 ) ); + m_xerr_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_xerr_impl(std::forward(arg)); }); + m_dxdt_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_dxdt_impl(std::forward(arg)); }); m_coeff.predict(t, dt); if (m_coeff.m_steps_init == 1) diff --git a/include/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp b/include/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp index 08009dc1..faba72ae 100644 --- a/include/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp +++ b/include/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp @@ -179,7 +179,7 @@ public: do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) { typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); sys( in , m_dxdt.m_v ,t ); this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt ); } @@ -258,7 +258,7 @@ public: void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr ) { typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); sys( in , m_dxdt.m_v ,t ); this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt , xerr ); } @@ -289,7 +289,7 @@ private: void do_step_v1( System system , StateInOut &x , time_type t , time_type dt ) { typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); sys( x , m_dxdt.m_v , t ); this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt ); } @@ -298,7 +298,7 @@ private: void do_step_v5( System system , StateInOut &x , time_type t , time_type dt , Err &xerr ) { typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); sys( x , m_dxdt.m_v ,t ); this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt , xerr ); } diff --git a/include/boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp b/include/boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp index b1d751a0..6a930a8e 100644 --- a/include/boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp +++ b/include/boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp @@ -177,7 +177,7 @@ public: typename boost::disable_if< boost::is_same< StateIn , time_type > , void >::type do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) { - if( m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) + if( m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }) || m_first_call ) { initialize( system , in , t ); } @@ -251,7 +251,7 @@ public: template< class System , class StateIn , class StateOut , class Err > void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr ) { - if( m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) + if( m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }) || m_first_call ) { initialize( system , in , t ); } @@ -310,7 +310,7 @@ private: template< class System , class StateInOut > void do_step_v1( System system , StateInOut &x , time_type t , time_type dt ) { - if( m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) + if( m_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }) || m_first_call ) { initialize( system , x , t ); } @@ -320,7 +320,7 @@ private: template< class System , class StateInOut , class Err > void do_step_v5( System system , StateInOut &x , time_type t , time_type dt , Err &xerr ) { - if( m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) + if( m_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }) || m_first_call ) { initialize( system , x , t ); } diff --git a/include/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp b/include/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp index d81c8c7a..8cb1a6ba 100644 --- a/include/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp +++ b/include/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp @@ -162,7 +162,7 @@ public: void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) { typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); sys( in , m_dxdt.m_v ,t ); this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt ); } @@ -225,7 +225,7 @@ private: void do_step_v1( System system , StateInOut &x , time_type t , time_type dt ) { typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); sys( x , m_dxdt.m_v ,t ); this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt ); } diff --git a/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp b/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp index 32330d6e..11dc2cfd 100644 --- a/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp +++ b/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp @@ -136,7 +136,7 @@ public: template< class System , class CoorInOut , class MomentumInOut > void do_step( System system , CoorInOut &q , MomentumInOut &p , time_type t , time_type dt ) { - do_step( system , std::make_pair( detail::ref( q ) , detail::ref( p ) ) , t , dt ); + do_step( system , std::make_pair( std::ref( q ) , std::ref( p ) ) , t , dt ); } /** @@ -146,7 +146,7 @@ public: template< class System , class CoorInOut , class MomentumInOut > void do_step( System system , const CoorInOut &q , const MomentumInOut &p , time_type t , time_type dt ) { - do_step( system , std::make_pair( detail::ref( q ) , detail::ref( p ) ) , t , dt ); + do_step( system , std::make_pair( std::ref( q ) , std::ref( p ) ) , t , dt ); } @@ -206,8 +206,8 @@ private: coor_out_type &coor_out = state_out.first; momentum_out_type &momentum_out = state_out.second; - m_dqdt_resizer.adjust_size( coor_in , detail::bind( &internal_stepper_base_type::template resize_dqdt< coor_in_type > , detail::ref( *this ) , detail::_1 ) ); - m_dpdt_resizer.adjust_size( momentum_in , detail::bind( &internal_stepper_base_type::template resize_dpdt< momentum_in_type > , detail::ref( *this ) , detail::_1 ) ); + m_dqdt_resizer.adjust_size(coor_in, [this](auto&& arg) { return this->resize_dqdt(std::forward(arg)); }); + m_dpdt_resizer.adjust_size(momentum_in, [this](auto&& arg) { return this->resize_dpdt(std::forward(arg)); }); // ToDo: check sizes? @@ -258,8 +258,7 @@ private: // m_dqdt not required when called with momentum_func only - don't resize - // m_dqdt_resizer.adjust_size( coor_in , detail::bind( &internal_stepper_base_type::template resize_dqdt< coor_in_type > , detail::ref( *this ) , detail::_1 ) ); - m_dpdt_resizer.adjust_size( momentum_in , detail::bind( &internal_stepper_base_type::template resize_dpdt< momentum_in_type > , detail::ref( *this ) , detail::_1 ) ); + m_dpdt_resizer.adjust_size(momentum_in, [this](auto&& arg) { return this->resize_dpdt(std::forward(arg)); }); // ToDo: check sizes? diff --git a/include/boost/numeric/odeint/stepper/bulirsch_stoer.hpp b/include/boost/numeric/odeint/stepper/bulirsch_stoer.hpp index 02c37492..ec60951f 100644 --- a/include/boost/numeric/odeint/stepper/bulirsch_stoer.hpp +++ b/include/boost/numeric/odeint/stepper/bulirsch_stoer.hpp @@ -152,7 +152,7 @@ public: template< class System , class StateInOut , class DerivIn > controlled_step_result try_step( System system , StateInOut &x , const DerivIn &dxdt , time_type &t , time_type &dt ) { - m_xnew_resizer.adjust_size( x , detail::bind( &controlled_error_bs_type::template resize_m_xnew< StateInOut > , detail::ref( *this ) , detail::_1 ) ); + m_xnew_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_m_xnew(std::forward(arg)); }); controlled_step_result res = try_step( system , x , dxdt , t , m_xnew.m_v , dt ); if( res == success ) { @@ -171,7 +171,7 @@ public: try_step( System system , const StateIn &in , time_type &t , StateOut &out , time_type &dt ) { typename odeint::unwrap_reference< System >::type &sys = system; - m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_error_bs_type::template resize_m_dxdt< StateIn > , detail::ref( *this ) , detail::_1 ) ); + m_dxdt_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_m_dxdt(std::forward(arg)); }); sys( in , m_dxdt.m_v , t ); return try_step( system , in , m_dxdt.m_v , t , out , dt ); } @@ -198,7 +198,7 @@ public: static const value_type val1( 1.0 ); - if( m_resizer.adjust_size( in , detail::bind( &controlled_error_bs_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) ) + if( m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }) ) { reset(); // system resized -> reset } @@ -388,7 +388,7 @@ private: controlled_step_result try_step_v1( System system , StateInOut &x , time_type &t , time_type &dt ) { typename odeint::unwrap_reference< System >::type &sys = system; - m_dxdt_resizer.adjust_size( x , detail::bind( &controlled_error_bs_type::template resize_m_dxdt< StateInOut > , detail::ref( *this ) , detail::_1 ) ); + m_dxdt_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_m_dxdt(std::forward(arg)); }); sys( x , m_dxdt.m_v ,t ); return try_step( system , x , m_dxdt.m_v , t , dt ); } diff --git a/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp b/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp index 425d9433..1b2321d2 100644 --- a/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp +++ b/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp @@ -308,7 +308,7 @@ public: template< class StateType > void initialize( const StateType &x0 , const time_type &t0 , const time_type &dt0 ) { - m_resizer.adjust_size( x0 , detail::bind( &controlled_error_bs_type::template resize_impl< StateType > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x0, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); boost::numeric::odeint::copy( x0 , get_current_state() ); m_t = t0; m_dt = dt0; diff --git a/include/boost/numeric/odeint/stepper/controlled_adams_bashforth_moulton.hpp b/include/boost/numeric/odeint/stepper/controlled_adams_bashforth_moulton.hpp index 6d3f6c64..68157dae 100644 --- a/include/boost/numeric/odeint/stepper/controlled_adams_bashforth_moulton.hpp +++ b/include/boost/numeric/odeint/stepper/controlled_adams_bashforth_moulton.hpp @@ -178,7 +178,7 @@ public: reset(); coeff_type &coeff = m_stepper.coeff(); - m_dxdt_resizer.adjust_size( inOut , detail::bind( &controlled_stepper_type::template resize_dxdt_impl< state_type > , detail::ref( *this ) , detail::_1 ) ); + m_dxdt_resizer.adjust_size(inOut, [this](auto&& arg) { return this->resize_dxdt_impl(std::forward(arg)); }); controlled_step_result res = fail; @@ -206,7 +206,7 @@ public: template< class System > controlled_step_result try_step(System system, state_type & inOut, time_type &t, time_type &dt) { - m_xnew_resizer.adjust_size( inOut , detail::bind( &controlled_stepper_type::template resize_xnew_impl< state_type > , detail::ref( *this ) , detail::_1 ) ); + m_xnew_resizer.adjust_size(inOut, [this](auto&& arg) { return this->resize_xnew_impl(std::forward(arg)); }); controlled_step_result res = try_step(system, inOut, t, m_xnew.m_v, dt); @@ -221,8 +221,8 @@ public: template< class System > controlled_step_result try_step(System system, const state_type & in, time_type &t, state_type & out, time_type &dt) { - m_xerr_resizer.adjust_size( in , detail::bind( &controlled_stepper_type::template resize_xerr_impl< state_type > , detail::ref( *this ) , detail::_1 ) ); - m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_stepper_type::template resize_dxdt_impl< state_type > , detail::ref( *this ) , detail::_1 ) ); + m_xerr_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_xerr_impl(std::forward(arg)); }); + m_dxdt_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_dxdt_impl(std::forward(arg)); }); m_stepper.do_step_impl(system, in, t, out, dt, m_xerr[2].m_v); diff --git a/include/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp b/include/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp index b5eea148..be2555bd 100644 --- a/include/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp +++ b/include/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp @@ -337,7 +337,7 @@ public: template< class System , class StateInOut , class DerivIn > controlled_step_result try_step( System system , StateInOut &x , const DerivIn &dxdt , time_type &t , time_type &dt ) { - m_xnew_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_xnew_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); + m_xnew_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_m_xnew_impl(std::forward(arg)); }); controlled_step_result res = try_step( system , x , dxdt , t , m_xnew.m_v , dt ); if( res == success ) { @@ -378,7 +378,7 @@ public: try_step( System system , const StateIn &in , time_type &t , StateOut &out , time_type &dt ) { typename odeint::unwrap_reference< System >::type &sys = system; - m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); + m_dxdt_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_m_dxdt_impl(std::forward(arg)); }); sys( in , m_dxdt.m_v , t ); return try_step( system , in , m_dxdt.m_v , t , out , dt ); } @@ -419,7 +419,7 @@ public: return fail; } - m_xerr_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_xerr_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); + m_xerr_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_m_xerr_impl(std::forward(arg)); }); // do one step with error calculation m_stepper.do_step( system , in , dxdt , t , out , dt , m_xerr.m_v ); @@ -478,7 +478,7 @@ private: controlled_step_result try_step_v1( System system , StateInOut &x , time_type &t , time_type &dt ) { typename odeint::unwrap_reference< System >::type &sys = system; - m_dxdt_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); + m_dxdt_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_m_dxdt_impl(std::forward(arg)); }); sys( x , m_dxdt.m_v ,t ); return try_step( system , x , m_dxdt.m_v , t , dt ); } @@ -678,7 +678,7 @@ public: typename boost::disable_if< boost::is_same< StateIn , time_type > , controlled_step_result >::type try_step( System system , const StateIn &in , time_type &t , StateOut &out , time_type &dt ) { - if( m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) + if( m_dxdt_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_m_dxdt_impl(std::forward(arg)); }) || m_first_call ) { initialize( system , in , t ); } @@ -713,8 +713,8 @@ public: template< class System , class StateInOut , class DerivInOut > controlled_step_result try_step( System system , StateInOut &x , DerivInOut &dxdt , time_type &t , time_type &dt ) { - m_xnew_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_xnew_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); - m_dxdt_new_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_new_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); + m_xnew_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_m_xnew_impl(std::forward(arg)); }); + m_dxdt_new_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_m_dxdt_new_impl(std::forward(arg)); }); controlled_step_result res = try_step( system , x , dxdt , t , m_xnew.m_v , m_dxdtnew.m_v , dt ); if( res == success ) { @@ -761,7 +761,7 @@ public: return fail; } - m_xerr_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_xerr_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); + m_xerr_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_m_xerr_impl(std::forward(arg)); }); //fsal: m_stepper.get_dxdt( dxdt ); //fsal: m_stepper.do_step( sys , x , dxdt , t , dt , m_x_err ); @@ -895,7 +895,7 @@ private: template< class System , class StateInOut > controlled_step_result try_step_v1( System system , StateInOut &x , time_type &t , time_type &dt ) { - if( m_dxdt_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) + if( m_dxdt_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_m_dxdt_impl(std::forward(arg)); }) || m_first_call ) { initialize( system , x , t ); } diff --git a/include/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp b/include/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp index 83982dc7..ab8a29a2 100644 --- a/include/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp +++ b/include/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp @@ -105,7 +105,7 @@ public: template< class StateType > void initialize( const StateType &x0 , time_type t0 , time_type dt0 ) { - m_resizer.adjust_size( x0 , detail::bind( &dense_output_stepper_type::template resize_impl< StateType > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x0, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); boost::numeric::odeint::copy( x0 , get_current_state() ); m_t = t0; m_dt = dt0; @@ -313,7 +313,7 @@ public: template< class StateType > void initialize( const StateType &x0 , time_type t0 , time_type dt0 ) { - m_resizer.adjust_size( x0 , detail::bind( &dense_output_stepper_type::template resize< StateType > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x0, [this](auto&& arg) { return this->resize(std::forward(arg)); }); boost::numeric::odeint::copy( x0 , get_current_state() ); m_t = t0; m_dt = dt0; diff --git a/include/boost/numeric/odeint/stepper/detail/adaptive_adams_coefficients.hpp b/include/boost/numeric/odeint/stepper/detail/adaptive_adams_coefficients.hpp index 90530c50..f36f93fb 100644 --- a/include/boost/numeric/odeint/stepper/detail/adaptive_adams_coefficients.hpp +++ b/include/boost/numeric/odeint/stepper/detail/adaptive_adams_coefficients.hpp @@ -132,7 +132,7 @@ public: void do_step(const deriv_type &dxdt, const int o = 0) { - m_phi_resizer.adjust_size( dxdt , detail::bind( &aac_type::template resize_phi_impl< deriv_type > , detail::ref( *this ) , detail::_1 ) ); + m_phi_resizer.adjust_size(dxdt, [this](auto&& arg) { return this->resize_phi_impl(std::forward(arg)); }); phi[o][0].m_v = dxdt; diff --git a/include/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp b/include/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp index 3c59810b..cca48232 100644 --- a/include/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp +++ b/include/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp @@ -129,7 +129,7 @@ public: void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) { - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); // actual calculation done in generic_rk.hpp m_rk_algorithm.do_step( stepper_base_type::m_algebra , system , in , dxdt , t , out , dt , m_x_tmp.m_v , m_F ); diff --git a/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp b/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp index 72a933c5..27c6ec8e 100644 --- a/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp +++ b/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp @@ -146,7 +146,7 @@ public: void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) { - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); // actual calculation done in generic_rk.hpp m_rk_algorithm.do_step( stepper_base_type::m_algebra , system , in , dxdt , t , out , dt , m_x_tmp.m_v , m_F ); diff --git a/include/boost/numeric/odeint/stepper/extrapolation_stepper.hpp b/include/boost/numeric/odeint/stepper/extrapolation_stepper.hpp index e78d38d0..b5cce25b 100644 --- a/include/boost/numeric/odeint/stepper/extrapolation_stepper.hpp +++ b/include/boost/numeric/odeint/stepper/extrapolation_stepper.hpp @@ -172,9 +172,7 @@ class extrapolation_stepper : public explicit_error_stepper_base void do_step_impl( System system, const StateIn &in, const DerivIn &dxdt, time_type t, StateOut &out, time_type dt ) { - m_resizer.adjust_size( - in, detail::bind( &stepper_type::template resize_impl< StateIn >, - detail::ref( *this ), detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); size_t k = 0; m_midpoint.set_steps( m_interval_sequence[k] ); m_midpoint.do_step( system, in, dxdt, t, out, dt ); @@ -191,10 +189,7 @@ class extrapolation_stepper : public explicit_error_stepper_base time_type t, time_type dt ) { // special care for inout - m_xout_resizer.adjust_size( - inout, - detail::bind( &stepper_type::template resize_m_xout< StateInOut >, - detail::ref( *this ), detail::_1 ) ); + m_xout_resizer.adjust_size(inout, [this](auto&& arg) { return this->resize_m_xout(std::forward(arg)); }); do_step_impl( system, inout, dxdt, t, m_xout.m_v, dt ); boost::numeric::odeint::copy( m_xout.m_v, inout ); } diff --git a/include/boost/numeric/odeint/stepper/implicit_euler.hpp b/include/boost/numeric/odeint/stepper/implicit_euler.hpp index e1c64164..bff24dbc 100644 --- a/include/boost/numeric/odeint/stepper/implicit_euler.hpp +++ b/include/boost/numeric/odeint/stepper/implicit_euler.hpp @@ -80,7 +80,7 @@ public: deriv_func_type &deriv_func = sys.first; jacobi_func_type &jacobi_func = sys.second; - m_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_impl , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); for( size_t i=0 ; i( 1 ); static const value_type val05 = static_cast< value_type >( 1 ) / static_cast< value_type >( 2 ); - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); const time_type h = dt / static_cast( m_steps ); const time_type h2 = static_cast(2) * h; @@ -204,7 +204,7 @@ public : static const value_type val1 = static_cast< value_type >( 1 ); static const value_type val05 = static_cast< value_type >( 1 ) / static_cast< value_type >( 2 ); - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize< StateIn > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize(std::forward(arg)); }); const time_type h = dt / static_cast( m_steps ); const time_type h2 = static_cast( 2 ) * h; diff --git a/include/boost/numeric/odeint/stepper/rosenbrock4.hpp b/include/boost/numeric/odeint/stepper/rosenbrock4.hpp index 86136989..94933ff8 100644 --- a/include/boost/numeric/odeint/stepper/rosenbrock4.hpp +++ b/include/boost/numeric/odeint/stepper/rosenbrock4.hpp @@ -178,7 +178,7 @@ public: const size_t n = x.size(); - m_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_impl , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); for( size_t i=0 ; i void do_step( System system , const state_type &x , time_type t , state_type &xout , time_type dt ) { - m_x_err_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_x_err , detail::ref( *this ) , detail::_1 ) ); + m_x_err_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_x_err(std::forward(arg)); }); do_step( system , x , t , xout , dt , m_x_err.m_v ); } template< class System > void do_step( System system , state_type &x , time_type t , time_type dt ) { - m_x_err_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_x_err , detail::ref( *this ) , detail::_1 ) ); + m_x_err_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_x_err(std::forward(arg)); }); do_step( system , x , t , dt , m_x_err.m_v ); } diff --git a/include/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp b/include/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp index 5ad1600d..a60bf5c3 100644 --- a/include/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp +++ b/include/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp @@ -99,7 +99,7 @@ public: boost::numeric::odeint::controlled_step_result try_step( System sys , state_type &x , time_type &t , time_type &dt ) { - m_xnew_resizer.adjust_size( x , detail::bind( &controller_type::template resize_m_xnew< state_type > , detail::ref( *this ) , detail::_1 ) ); + m_xnew_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_m_xnew(std::forward(arg)); }); boost::numeric::odeint::controlled_step_result res = try_step( sys , x , t , m_xnew.m_v , dt ); if( res == success ) { @@ -127,7 +127,7 @@ public: static const value_type safe = 0.9 , fac1 = 5.0 , fac2 = 1.0 / 6.0; - m_xerr_resizer.adjust_size( x , detail::bind( &controller_type::template resize_m_xerr< state_type > , detail::ref( *this ) , detail::_1 ) ); + m_xerr_resizer.adjust_size(x, [this](auto&& arg) { return this->resize_m_xerr(std::forward(arg)); }); m_stepper.do_step( sys , x , t , xout , dt , m_xerr.m_v ); value_type err = error( xout , x , m_xerr.m_v ); diff --git a/include/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp b/include/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp index d296246a..860a121d 100644 --- a/include/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp +++ b/include/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp @@ -67,7 +67,7 @@ public: template< class StateType > void initialize( const StateType &x0 , time_type t0 , time_type dt0 ) { - m_resizer.adjust_size( x0 , detail::bind( &dense_output_stepper_type::template resize_impl< StateType > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(x0, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); get_current_state() = x0; m_t = t0; m_dt = dt0; diff --git a/include/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp b/include/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp index 32bda0bd..1c6a1f9e 100644 --- a/include/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp +++ b/include/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp @@ -91,7 +91,7 @@ public : static const value_type val1 = static_cast< value_type >( 1 ); - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); typename odeint::unwrap_reference< System >::type &sys = system; diff --git a/include/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp b/include/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp index 80f1a3c0..06d5f50c 100644 --- a/include/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp +++ b/include/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp @@ -145,7 +145,7 @@ public : typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl , detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); //m_x1 = x + dt*b21*dxdt stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , dxdt , diff --git a/include/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp b/include/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp index 260cd74f..1ae51b4c 100644 --- a/include/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp +++ b/include/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp @@ -125,7 +125,7 @@ public : typename odeint::unwrap_reference< System >::type &sys = system; - m_k_x_tmp_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_k_x_tmp_impl , detail::ref( *this ) , detail::_1 ) ); + m_k_x_tmp_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_k_x_tmp_impl(std::forward(arg)); }); //m_x_tmp = x + dt*b21*dxdt stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , dxdt_in , @@ -179,7 +179,7 @@ public : /* ToDo: copy only if &dxdt_in == &dxdt_out ? */ if( same_instance( dxdt_in , dxdt_out ) ) { - m_dxdt_tmp_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_dxdt_tmp_impl , detail::ref( *this ) , detail::_1 ) ); + m_dxdt_tmp_resizer.adjust_size(in, [this](auto&& arg) { return this->resize_dxdt_tmp_impl(std::forward(arg)); }); boost::numeric::odeint::copy( dxdt_in , m_dxdt_tmp.m_v ); do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt ); //error estimate diff --git a/include/boost/numeric/odeint/stepper/velocity_verlet.hpp b/include/boost/numeric/odeint/stepper/velocity_verlet.hpp index f5a28bc0..b898c51d 100644 --- a/include/boost/numeric/odeint/stepper/velocity_verlet.hpp +++ b/include/boost/numeric/odeint/stepper/velocity_verlet.hpp @@ -149,9 +149,7 @@ public: void initialize( const AccelerationIn & ain ) { // alloc a - m_resizer.adjust_size( ain , - detail::bind( &velocity_verlet::template resize_impl< AccelerationIn > , - detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(ain, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); boost::numeric::odeint::copy( ain , get_current_acc() ); m_first_call = false; } @@ -160,9 +158,7 @@ public: template< class System , class CoorIn , class VelocityIn > void initialize( System system , const CoorIn & qin , const VelocityIn & pin , time_type t ) { - m_resizer.adjust_size( qin , - detail::bind( &velocity_verlet::template resize_impl< CoorIn > , - detail::ref( *this ) , detail::_1 ) ); + m_resizer.adjust_size(qin, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }); initialize_acc( system , qin , pin , t ); } @@ -195,10 +191,8 @@ private: momentum_in_type & pinout = statein.second; // alloc a - if( m_resizer.adjust_size( qinout , - detail::bind( &velocity_verlet::template resize_impl< xyz_type > , - detail::ref( *this ) , detail::_1 ) ) - || m_first_call ) + if( m_resizer.adjust_size(qinout, [this](auto&& arg) { return this->resize_impl(std::forward(arg)); }) + || m_first_call ) { initialize_acc( system , qinout , pinout , t ); } diff --git a/include/boost/numeric/odeint/util/bind.hpp b/include/boost/numeric/odeint/util/bind.hpp index 1201afab..27826f07 100644 --- a/include/boost/numeric/odeint/util/bind.hpp +++ b/include/boost/numeric/odeint/util/bind.hpp @@ -17,85 +17,19 @@ #ifndef BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED - -#include - - -#if BOOST_NUMERIC_ODEINT_CXX11 - #include -#else -#define BOOST_BIND_NO_PLACEHOLDERS -#include -#endif - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -#if BOOST_NUMERIC_ODEINT_CXX11 - -using ::std::bind; -using namespace ::std::placeholders; - - -#else - -// unnamed namespace to avoid multiple declarations (#138) -namespace { -using ::boost::bind; -boost::arg<1> _1; -boost::arg<2> _2; -} -// using ::boost::bind; -// using ::_1; -// using ::_2; - -#endif - -} -} -} -} - - - - - -/* - -// the following is the suggested way. Unfortunately it does not work with all compilers. - -#ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL -#include -#else #include -#endif - namespace boost { namespace numeric { namespace odeint { namespace detail { - -#ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL +using std::bind; +using namespace std::placeholders; -using ::boost::bind; -using ::_1; -using ::_2; - -#else - -using ::std::bind; -using namespace ::std::placeholders; - -#endif - - -} -} -} -}*/ +} //namespace detail +} //namespace odeint +} //namespace numeric +} //namespace boost #endif // BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED diff --git a/include/boost/numeric/odeint/util/unwrap_reference.hpp b/include/boost/numeric/odeint/util/unwrap_reference.hpp index e1608783..bbe087b2 100644 --- a/include/boost/numeric/odeint/util/unwrap_reference.hpp +++ b/include/boost/numeric/odeint/util/unwrap_reference.hpp @@ -20,28 +20,16 @@ #include - - -#if BOOST_NUMERIC_ODEINT_CXX11 #include -#else -#include -#endif namespace boost { -#if BOOST_NUMERIC_ODEINT_CXX11 template class reference_wrapper; - template struct unwrap_reference; -#endif namespace numeric { namespace odeint { - -#if BOOST_NUMERIC_ODEINT_CXX11 - template struct unwrap_reference { @@ -60,24 +48,11 @@ struct unwrap_reference< boost::reference_wrapper > typedef typename boost::unwrap_reference::type type; }; -#else - -using ::boost::unwrap_reference; - -#endif - namespace detail { -#if BOOST_NUMERIC_ODEINT_CXX11 - using ::std::ref; -#else - -using ::boost::ref; - -#endif } } diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 33caa4c5..9a6df98d 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -27,8 +27,7 @@ project static clang:-Wno-unused-variable # -D_SCL_SECURE_NO_WARNINGS - [ requires cxx11_noexcept cxx11_rvalue_references sfinae_expr cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_hdr_chrono cxx11_thread_local cxx11_constexpr cxx11_nullptr cxx11_numeric_limits cxx11_decltype cxx11_hdr_array cxx11_hdr_atomic cxx11_hdr_type_traits cxx11_allocator cxx11_explicit_conversion_operators ] - ; + [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction ] ; test-suite "odeint" : diff --git a/test/resizing.cpp b/test/resizing.cpp index 2dede6e9..f263927e 100644 --- a/test/resizing.cpp +++ b/test/resizing.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include diff --git a/test/runge_kutta_concepts.cpp b/test/runge_kutta_concepts.cpp index 8fa073f7..70c97168 100644 --- a/test/runge_kutta_concepts.cpp +++ b/test/runge_kutta_concepts.cpp @@ -34,7 +34,6 @@ #include #include -#include #include #include diff --git a/test/runge_kutta_controlled_concepts.cpp b/test/runge_kutta_controlled_concepts.cpp index 8a1e9b0f..4cd8d3bc 100644 --- a/test/runge_kutta_controlled_concepts.cpp +++ b/test/runge_kutta_controlled_concepts.cpp @@ -34,7 +34,6 @@ #include #include -#include #include #include diff --git a/test/runge_kutta_error_concepts.cpp b/test/runge_kutta_error_concepts.cpp index 5afe589e..3779c3e9 100644 --- a/test/runge_kutta_error_concepts.cpp +++ b/test/runge_kutta_error_concepts.cpp @@ -34,7 +34,6 @@ #include #include -#include #include #include