3 boost/numeric/odeint/util/unwrap_reference.hpp
9 Copyright 2012-2013 Karsten Ahnert
10 Copyright 2012-2013 Mario Mulansky
12 Distributed under the Boost Software License, Version 1.0.
13 (See accompanying file LICENSE_1_0.txt or
14 copy at http://www.boost.org/LICENSE_1_0.txt)
18 #ifndef BOOST_NUMERIC_ODEINT_UTIL_UNWRAP_REFERENCE_HPP_INCLUDED
19 #define BOOST_NUMERIC_ODEINT_UTIL_UNWRAP_REFERENCE_HPP_INCLUDED
22 #include <boost/numeric/odeint/config.hpp>
25 #if BOOST_NUMERIC_ODEINT_CXX11
28 #include <boost/ref.hpp>
33 #if BOOST_NUMERIC_ODEINT_CXX11
34 template<typename T> class reference_wrapper;
36 template<typename T> struct unwrap_reference;
43 #if BOOST_NUMERIC_ODEINT_CXX11
46 struct unwrap_reference
48 typedef typename std::remove_reference<T>::type type;
52 struct unwrap_reference< std::reference_wrapper<T> >
54 typedef typename std::remove_reference<T>::type type;
58 struct unwrap_reference< boost::reference_wrapper<T> >
60 typedef typename boost::unwrap_reference<T>::type type;
65 using ::boost::unwrap_reference;
72 #if BOOST_NUMERIC_ODEINT_CXX11
91 * the following is the suggested way, but unfortunately it does not work with all compilers.
96 #include <boost/config.hpp>
99 #ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL
100 #include <boost/ref.hpp>
102 #include <functional>
112 #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
115 struct unwrap_reference
117 typedef typename std::remove_reference<T>::type type;
121 struct unwrap_reference< std::reference_wrapper<T> >
123 typedef typename std::remove_reference<T>::type type;
127 struct unwrap_reference< boost::reference_wrapper<T> >
129 typedef typename boost::unwrap_reference<T>::type type;
134 using ::boost::unwrap_reference;
148 #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
166 #endif // BOOST_NUMERIC_ODEINT_UTIL_UNWRAP_REFERENCE_HPP_INCLUDED