Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:38

0001 
0002 #ifndef BOOST_MPL_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2000-2004
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. 
0008 // (See accompanying file LICENSE_1_0.txt or copy at 
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 //
0011 // See http://www.boost.org/libs/mpl for documentation.
0012 
0013 // $Id$
0014 // $Date$
0015 // $Revision$
0016 
0017 #include <boost/mpl/placeholders.hpp>
0018 #include <boost/mpl/fold.hpp>
0019 #include <boost/mpl/insert.hpp>
0020 #include <boost/mpl/clear.hpp>
0021 #include <boost/mpl/joint_view.hpp>
0022 #include <boost/mpl/iterator_range.hpp>
0023 #include <boost/mpl/aux_/na_spec.hpp>
0024 #include <boost/mpl/aux_/iter_push_front.hpp>
0025 #include <boost/mpl/aux_/traits_lambda_spec.hpp>
0026 #include <boost/mpl/aux_/config/forwarding.hpp>
0027 
0028 #include <boost/type_traits/same_traits.hpp>
0029 
0030 namespace boost { namespace mpl {
0031 
0032 // default implementation; conrete sequences might override it by 
0033 // specializing either the 'insert_range_impl' or the primary 
0034 // 'insert_range' template
0035 
0036 
0037 template< typename Tag >
0038 struct insert_range_impl
0039 {
0040     template<
0041           typename Sequence
0042         , typename Pos
0043         , typename Range
0044         >
0045     struct apply
0046 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
0047         : reverse_fold<
0048               joint_view<
0049                   iterator_range<typename begin<Sequence>::type,Pos>
0050                 , joint_view<
0051                       Range
0052                     , iterator_range<Pos,typename end<Sequence>::type>
0053                     >
0054                 >
0055             , typename clear<Sequence>::type
0056             , insert<_1, begin<_1>, _2>
0057             >
0058     {
0059 #else
0060     {
0061         typedef typename reverse_fold<
0062                 joint_view<
0063                     iterator_range<typename begin<Sequence>::type,Pos>
0064                   , joint_view<
0065                         Range
0066                       , iterator_range<Pos,typename end<Sequence>::type>
0067                       >
0068                   >
0069               , typename clear<Sequence>::type
0070               , insert<_1, begin<_1>, _2>
0071               >::type type;
0072 #endif
0073     };
0074 };
0075 
0076 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(3,insert_range_impl)
0077 
0078 }}
0079 
0080 #endif // BOOST_MPL_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED