From e008a015b6ef5e7c3d44a656742f986026c2ea29 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Fri, 22 Dec 2023 08:28:07 -0500 Subject: [PATCH] Remove use of Boost.Bind --- CMakeLists.txt | 1 - examples/stepper_details.cpp | 3 +- include/boost/numeric/odeint/util/bind.hpp | 74 ++-------------------- test/resizing.cpp | 1 - test/runge_kutta_concepts.cpp | 1 - test/runge_kutta_controlled_concepts.cpp | 1 - test/runge_kutta_error_concepts.cpp | 1 - 7 files changed, 5 insertions(+), 77 deletions(-) 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/util/bind.hpp b/include/boost/numeric/odeint/util/bind.hpp index 1201afab..b0a9af74 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 ::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/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