headmyshoulder/odeint-v2 — pull request #25 by syntion (2012-04-05 09:49:17+00:00)
Title: C++11 support

Hello,

I really like your library, because it is the best C++ ODE Integrator I could find. But I use it in a project using C++11 and had the problem that I get namespace conflicts with the std::placeholders.
This is caused by the usage of boost bind, as it pulled its placeholder (_1, _2, _3, etc.) into the global namespace.

To avoid this I did the following changes:
I introduced the define BOOST_NUMERIC_ODEINT_CXX11 to enable the use of the C++11 header functional instead of boost/bind.hpp and boost/ref.hpp.
To keep the code as untouched as possible i pull in the placeholders and the functions ref, bind and unwrap_reference into the namespace boost::numeric::odeint::detail. All changes to the code have been the following replacements:
boost::ref -> detail::ref
boost::bind -> detail::ref
boost::unwrap_reference -> detail::unwrap_reference
_1 -> detail::_1
And to add the header utils/bind.hpp which has to be used instead of boost/bind.hpp and boost/ref.hpp.

I tested this with gcc 4.6.2 and gcc 4.7.0 alpha snapshort, with both all examples, regressions tests and tests are running fine.
BOOST_ROOT=$HOME/tmp/src/odeint-v2" bjam-1_48 toolset=gcc cxxflags="-std=c++0x -DBOOST_NUMERIC_ODEINT_CXX11=1"

I hope it will work also on other platforms.

How do you think about this changes? Do you think it will be possible for you to pull them into your codebase? And would there be need for some documentation?

Best Wishes
syntion