Remove use of Boost.Bind

This commit is contained in:
Matt Borland 2023-12-22 08:28:07 -05:00
parent f07b2ac947
commit e008a015b6
No known key found for this signature in database
GPG Key ID: 30EFCE23CA65A72C
7 changed files with 5 additions and 77 deletions

View File

@ -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

View File

@ -15,7 +15,6 @@
#include <iostream>
#include <array>
#include <boost/bind.hpp>
#include <boost/numeric/odeint.hpp>
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 );
//]
}

View File

@ -17,85 +17,19 @@
#ifndef BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED
#include <boost/numeric/odeint/config.hpp>
#if BOOST_NUMERIC_ODEINT_CXX11
#include <functional>
#else
#define BOOST_BIND_NO_PLACEHOLDERS
#include <boost/bind.hpp>
#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 <boost/bind.hpp>
#else
#include <functional>
#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

View File

@ -26,7 +26,6 @@
#include <cmath>
#include <array>
#include <boost/bind.hpp>
#include <boost/utility.hpp>
#include <boost/type_traits/integral_constant.hpp>

View File

@ -34,7 +34,6 @@
#include <boost/test/unit_test.hpp>
#include <boost/ref.hpp>
#include <boost/bind.hpp>
#include <boost/utility.hpp>
#include <boost/type_traits/add_reference.hpp>

View File

@ -34,7 +34,6 @@
#include <boost/test/unit_test.hpp>
#include <boost/ref.hpp>
#include <boost/bind.hpp>
#include <boost/utility.hpp>
#include <boost/type_traits/add_reference.hpp>

View File

@ -34,7 +34,6 @@
#include <boost/test/unit_test.hpp>
#include <boost/ref.hpp>
#include <boost/bind.hpp>
#include <boost/utility.hpp>
#include <boost/type_traits/add_reference.hpp>