Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 08:41:01

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 #include <type_traits>
0024 
0025 #include <boost/type_traits/integral_constant.hpp>
0026 #include <boost/type_traits/remove_reference.hpp>
0027 #include <boost/fusion/include/front.hpp>
0028 #include <boost/fusion/include/is_sequence.hpp>
0029 
0030 #include <boost/mpl/find_if.hpp>
0031 #include <boost/mpl/end.hpp>
0032 #include <boost/mpl/placeholders.hpp>
0033 #include <boost/mpl/if.hpp>
0034 #include <boost/type_traits/is_same.hpp>
0035 
0036 namespace boost {
0037 namespace numeric {
0038 namespace odeint {
0039    
0040 /*
0041  * by default any type is not resizable
0042  */
0043 template< typename Container , typename Enabler = void >
0044 struct is_resizeable_sfinae : std::false_type {};
0045 
0046 template< typename Container >
0047 struct is_resizeable : is_resizeable_sfinae< Container > {};
0048 
0049 
0050 
0051 /*
0052  * specialization for std::vector
0053  */
0054 template< class V, class A >
0055 struct is_resizeable< std::vector< V , A  > > : std::true_type {};
0056 
0057 
0058 /*
0059  * sfinae specialization for fusion sequences
0060  */
0061 template< typename FusionSequence >
0062 struct is_resizeable_sfinae<
0063     FusionSequence ,
0064     typename boost::enable_if< typename boost::fusion::traits::is_sequence< FusionSequence >::type >::type >
0065 {
0066     typedef typename boost::mpl::find_if< FusionSequence , is_resizeable< boost::mpl::_1 > >::type iter;
0067     typedef typename boost::mpl::end< FusionSequence >::type last;
0068 
0069     typedef typename boost::mpl::if_< boost::is_same< iter , last > , std::false_type , std::true_type >::type type;
0070     const static bool value = type::value;
0071 };
0072 
0073 
0074 
0075 
0076 
0077 
0078 } // namespace odeint
0079 } // namespace numeric
0080 } // namespace boost
0081 
0082 
0083 
0084 #endif // BOOST_NUMERIC_ODEINT_UTIL_IS_RESIZEABLE_HPP_INCLUDED