File indexing completed on 2025-01-18 09:41:38
0001
0002 #ifndef BOOST_MPL_INSERT_IMPL_HPP_INCLUDED
0003 #define BOOST_MPL_INSERT_IMPL_HPP_INCLUDED
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <boost/mpl/reverse_fold.hpp>
0018 #include <boost/mpl/iterator_range.hpp>
0019 #include <boost/mpl/clear.hpp>
0020 #include <boost/mpl/push_front.hpp>
0021 #include <boost/mpl/aux_/na_spec.hpp>
0022 #include <boost/mpl/aux_/traits_lambda_spec.hpp>
0023 #include <boost/type_traits/is_same.hpp>
0024
0025 namespace boost { namespace mpl {
0026
0027
0028
0029
0030 template< typename Tag >
0031 struct insert_impl
0032 {
0033 template<
0034 typename Sequence
0035 , typename Pos
0036 , typename T
0037 >
0038 struct apply
0039 {
0040 typedef iterator_range<
0041 typename begin<Sequence>::type
0042 , Pos
0043 > first_half_;
0044
0045 typedef iterator_range<
0046 Pos
0047 , typename end<Sequence>::type
0048 > second_half_;
0049
0050 typedef typename reverse_fold<
0051 second_half_
0052 , typename clear<Sequence>::type
0053 , push_front<_,_>
0054 >::type half_sequence_;
0055
0056 typedef typename reverse_fold<
0057 first_half_
0058 , typename push_front<half_sequence_,T>::type
0059 , push_front<_,_>
0060 >::type type;
0061 };
0062 };
0063
0064 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(3,insert_impl)
0065
0066 }}
0067
0068 #endif