Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:58

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/util/is_resizeable.hpp
0004 
0005  [begin_description]
0006  Metafunction to determine if a state type can resized. For usage in the steppers.
0007  [end_description]
0008 
0009  Copyright 2011-2012 Karsten Ahnert
0010  Copyright 2011 Mario Mulansky
0011 
0012  Distributed under the Boost Software License, Version 1.0.
0013  (See accompanying file LICENSE_1_0.txt or
0014  copy at http://www.boost.org/LICENSE_1_0.txt)
0015  */
0016 
0017 
0018 #ifndef BOOST_NUMERIC_ODEINT_UTIL_IS_RESIZEABLE_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_UTIL_IS_RESIZEABLE_HPP_INCLUDED
0020 
0021 
0022 #include <vector>
0023 
0024 #include <boost/type_traits/integral_constant.hpp>
0025 #include <boost/type_traits/remove_reference.hpp>
0026 #include <boost/fusion/include/front.hpp>
0027 #include <boost/fusion/include/is_sequence.hpp>
0028 
0029 #include <boost/mpl/find_if.hpp>
0030 #include <boost/mpl/end.hpp>
0031 #include <boost/mpl/placeholders.hpp>
0032 #include <boost/mpl/if.hpp>
0033 #include <boost/type_traits/is_same.hpp>
0034 
0035 namespace boost {
0036 namespace numeric {
0037 namespace odeint {
0038    
0039 /*
0040  * by default any type is not resizable
0041  */
0042 template< typename Container , typename Enabler = void >
0043 struct is_resizeable_sfinae : boost::false_type {};
0044 
0045 template< typename Container >
0046 struct is_resizeable : is_resizeable_sfinae< Container > {};
0047 
0048 
0049 
0050 /*
0051  * specialization for std::vector
0052  */
0053 template< class V, class A >
0054 struct is_resizeable< std::vector< V , A  > > : boost::true_type {};
0055 
0056 
0057 /*
0058  * sfinae specialization for fusion sequences
0059  */
0060 template< typename FusionSequence >
0061 struct is_resizeable_sfinae<
0062     FusionSequence ,
0063     typename boost::enable_if< typename boost::fusion::traits::is_sequence< FusionSequence >::type >::type >
0064 {
0065     typedef typename boost::mpl::find_if< FusionSequence , is_resizeable< boost::mpl::_1 > >::type iter;
0066     typedef typename boost::mpl::end< FusionSequence >::type last;
0067 
0068     typedef typename boost::mpl::if_< boost::is_same< iter , last > , boost::false_type , boost::true_type >::type type;
0069     const static bool value = type::value;
0070 };
0071 
0072 
0073 
0074 
0075 
0076 
0077 } // namespace odeint
0078 } // namespace numeric
0079 } // namespace boost
0080 
0081 
0082 
0083 #endif // BOOST_NUMERIC_ODEINT_UTIL_IS_RESIZEABLE_HPP_INCLUDED