File indexing completed on 2025-01-18 09:42:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED
0020
0021
0022 #include <boost/range/algorithm/copy.hpp>
0023
0024 #include <boost/utility/enable_if.hpp>
0025
0026 #include <boost/numeric/odeint/util/detail/is_range.hpp>
0027
0028 namespace boost {
0029 namespace numeric {
0030 namespace odeint {
0031
0032 namespace detail {
0033
0034 template< class Container1 , class Container2 >
0035 void do_copying( const Container1 &from , Container2 &to , boost::mpl::true_ )
0036 {
0037 boost::range::copy( from , boost::begin( to ) );
0038 }
0039
0040 template< class Container1 , class Container2 >
0041 void do_copying( const Container1 &from , Container2 &to , boost::mpl::false_ )
0042 {
0043 to = from;
0044 }
0045
0046 }
0047
0048
0049
0050
0051
0052
0053
0054 template< class Container1 , class Container2 , class Enabler = void >
0055 struct copy_impl_sfinae
0056 {
0057 static void copy( const Container1 &from , Container2 &to )
0058 {
0059 typedef typename boost::numeric::odeint::detail::is_range< Container1 >::type is_range_type;
0060 detail::do_copying( from , to , is_range_type() );
0061 }
0062
0063 };
0064
0065 template< class Container1, class Container2 >
0066 struct copy_impl
0067 {
0068 static void copy( const Container1 &from , Container2 &to )
0069 {
0070 copy_impl_sfinae< Container1 , Container2 >::copy( from , to );
0071 }
0072 };
0073
0074
0075 template< class Container1 , class Container2 >
0076 void copy( const Container1 &from , Container2 &to )
0077 {
0078 copy_impl< Container1 , Container2 >::copy( from , to );
0079 }
0080
0081
0082 }
0083 }
0084 }
0085
0086
0087 #endif