2 #ifndef BOOST_MPL_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
3 #define BOOST_MPL_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
5 // Copyright Aleksey Gurtovoy 2000-2004
7 // Distributed under the Boost Software License, Version 1.0.
8 // (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 // See http://www.boost.org/libs/mpl for documentation.
17 #include <boost/mpl/placeholders.hpp>
18 #include <boost/mpl/fold.hpp>
19 #include <boost/mpl/insert.hpp>
20 #include <boost/mpl/clear.hpp>
21 #include <boost/mpl/joint_view.hpp>
22 #include <boost/mpl/iterator_range.hpp>
23 #include <boost/mpl/aux_/na_spec.hpp>
24 #include <boost/mpl/aux_/iter_push_front.hpp>
25 #include <boost/mpl/aux_/traits_lambda_spec.hpp>
26 #include <boost/mpl/aux_/config/forwarding.hpp>
28 #include <boost/type_traits/same_traits.hpp>
30 namespace boost { namespace mpl {
32 // default implementation; conrete sequences might override it by
33 // specializing either the 'insert_range_impl' or the primary
34 // 'insert_range' template
37 template< typename Tag >
38 struct insert_range_impl
46 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
49 iterator_range<typename begin<Sequence>::type,Pos>
52 , iterator_range<Pos,typename end<Sequence>::type>
55 , typename clear<Sequence>::type
56 , insert<_1, begin<_1>, _2>
61 typedef typename reverse_fold<
63 iterator_range<typename begin<Sequence>::type,Pos>
66 , iterator_range<Pos,typename end<Sequence>::type>
69 , typename clear<Sequence>::type
70 , insert<_1, begin<_1>, _2>
76 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(3,insert_range_impl)
80 #endif // BOOST_MPL_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED