Chris@16: /* Chris@16: * [begin_description] Chris@16: * Boost bind pull the placeholders, _1, _2, ... into global Chris@16: * namespace. This can conflict with the C++03 TR1 and C++11 Chris@16: * std::placeholders. This header provides a workaround for Chris@16: * this problem. Chris@16: * [end_description] Chris@16: * Chris@16: * Copyright 2012 Christoph Koke Chris@101: * Copyright 2012 Karsten Ahnert Chris@16: * Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or Chris@16: * copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: * */ Chris@16: Chris@16: #ifndef BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED Chris@16: #define BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED Chris@16: Chris@16: Chris@16: #include Chris@16: Chris@16: Chris@16: #if BOOST_NUMERIC_ODEINT_CXX11 Chris@101: #include Chris@16: #else Chris@101: #define BOOST_BIND_NO_PLACEHOLDERS Chris@16: #include Chris@16: #endif Chris@16: Chris@16: namespace boost { Chris@16: namespace numeric { Chris@16: namespace odeint { Chris@16: namespace detail { Chris@16: Chris@16: #if BOOST_NUMERIC_ODEINT_CXX11 Chris@16: Chris@16: using ::std::bind; Chris@16: using namespace ::std::placeholders; Chris@16: Chris@16: Chris@16: #else Chris@16: Chris@101: // unnamed namespace to avoid multiple declarations (#138) Chris@101: namespace { Chris@101: using ::boost::bind; Chris@101: boost::arg<1> _1; Chris@101: boost::arg<2> _2; Chris@101: } Chris@101: // using ::boost::bind; Chris@101: // using ::_1; Chris@101: // using ::_2; Chris@101: Chris@101: #endif Chris@101: Chris@101: } Chris@101: } Chris@101: } Chris@101: } Chris@101: Chris@101: Chris@101: Chris@101: Chris@101: Chris@101: /* Chris@101: Chris@101: // the following is the suggested way. Unfortunately it does not work with all compilers. Chris@101: Chris@101: #ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL Chris@101: #include Chris@101: #else Chris@101: #include Chris@101: #endif Chris@101: Chris@101: Chris@101: namespace boost { Chris@101: namespace numeric { Chris@101: namespace odeint { Chris@101: namespace detail { Chris@101: Chris@101: Chris@101: #ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL Chris@101: Chris@16: using ::boost::bind; Chris@16: using ::_1; Chris@16: using ::_2; Chris@16: Chris@101: #else Chris@101: Chris@101: using ::std::bind; Chris@101: using namespace ::std::placeholders; Chris@101: Chris@16: #endif Chris@16: Chris@101: Chris@16: } Chris@16: } Chris@16: } Chris@101: }*/ Chris@16: Chris@16: #endif // BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED