epoc32/include/stdapis/boost/mpl/aux_/advance_forward.hpp
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/stdapis/boost/mpl/aux_/advance_forward.hpp	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/stdapis/boost/mpl/aux_/advance_forward.hpp	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,3 +1,10 @@
     1.4 +
     1.5 +#if !defined(BOOST_PP_IS_ITERATING)
     1.6 +
     1.7 +///// header body
     1.8 +
     1.9 +#ifndef BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
    1.10 +#define BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
    1.11  
    1.12  // Copyright Aleksey Gurtovoy 2000-2004
    1.13  //
    1.14 @@ -5,88 +12,60 @@
    1.15  // (See accompanying file LICENSE_1_0.txt or copy at 
    1.16  // http://www.boost.org/LICENSE_1_0.txt)
    1.17  //
    1.18 +// See http://www.boost.org/libs/mpl for documentation.
    1.19  
    1.20 -// Preprocessed version of "boost/mpl/aux_/advance_forward.hpp" header
    1.21 -// -- DO NOT modify by hand!
    1.22 +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/advance_forward.hpp,v $
    1.23 +// $Date: 2004/09/02 15:40:43 $
    1.24 +// $Revision: 1.9 $
    1.25 +
    1.26 +#if !defined(BOOST_MPL_PREPROCESSING_MODE)
    1.27 +#   include <boost/mpl/next.hpp>
    1.28 +#   include <boost/mpl/apply_wrap.hpp>
    1.29 +#endif
    1.30 +
    1.31 +#include <boost/mpl/aux_/config/use_preprocessed.hpp>
    1.32 +
    1.33 +#if    !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
    1.34 +    && !defined(BOOST_MPL_PREPROCESSING_MODE)
    1.35 +
    1.36 +#   define BOOST_MPL_PREPROCESSED_HEADER advance_forward.hpp
    1.37 +#   include <boost/mpl/aux_/include_preprocessed.hpp>
    1.38 +
    1.39 +#else
    1.40 +
    1.41 +#   include <boost/mpl/limits/unrolling.hpp>
    1.42 +#   include <boost/mpl/aux_/nttp_decl.hpp>
    1.43 +#   include <boost/mpl/aux_/config/eti.hpp>
    1.44 +
    1.45 +#   include <boost/preprocessor/iterate.hpp>
    1.46 +#   include <boost/preprocessor/cat.hpp>
    1.47 +#   include <boost/preprocessor/inc.hpp>
    1.48  
    1.49  namespace boost { namespace mpl { namespace aux {
    1.50  
    1.51 -template< long N > struct advance_forward;
    1.52 -template<>
    1.53 -struct advance_forward<0>
    1.54 -{
    1.55 -    template< typename Iterator > struct apply
    1.56 -    {
    1.57 -        typedef Iterator iter0;
    1.58 -        typedef iter0 type;
    1.59 -    };
    1.60 -};
    1.61 +// forward declaration
    1.62 +template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_forward;
    1.63  
    1.64 -template<>
    1.65 -struct advance_forward<1>
    1.66 -{
    1.67 -    template< typename Iterator > struct apply
    1.68 -    {
    1.69 -        typedef Iterator iter0;
    1.70 -        typedef typename next<iter0>::type iter1;
    1.71 -        typedef iter1 type;
    1.72 -    };
    1.73 -};
    1.74 +#   define BOOST_PP_ITERATION_PARAMS_1 \
    1.75 +    (3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_forward.hpp>))
    1.76 +#   include BOOST_PP_ITERATE()
    1.77  
    1.78 -template<>
    1.79 -struct advance_forward<2>
    1.80 -{
    1.81 -    template< typename Iterator > struct apply
    1.82 -    {
    1.83 -        typedef Iterator iter0;
    1.84 -        typedef typename next<iter0>::type iter1;
    1.85 -        typedef typename next<iter1>::type iter2;
    1.86 -        typedef iter2 type;
    1.87 -    };
    1.88 -};
    1.89 -
    1.90 -template<>
    1.91 -struct advance_forward<3>
    1.92 -{
    1.93 -    template< typename Iterator > struct apply
    1.94 -    {
    1.95 -        typedef Iterator iter0;
    1.96 -        typedef typename next<iter0>::type iter1;
    1.97 -        typedef typename next<iter1>::type iter2;
    1.98 -        typedef typename next<iter2>::type iter3;
    1.99 -        typedef iter3 type;
   1.100 -    };
   1.101 -};
   1.102 -
   1.103 -template<>
   1.104 -struct advance_forward<4>
   1.105 -{
   1.106 -    template< typename Iterator > struct apply
   1.107 -    {
   1.108 -        typedef Iterator iter0;
   1.109 -        typedef typename next<iter0>::type iter1;
   1.110 -        typedef typename next<iter1>::type iter2;
   1.111 -        typedef typename next<iter2>::type iter3;
   1.112 -        typedef typename next<iter3>::type iter4;
   1.113 -        typedef iter4 type;
   1.114 -    };
   1.115 -};
   1.116 -
   1.117 -template< long N >
   1.118 +// implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING
   1.119 +template< BOOST_MPL_AUX_NTTP_DECL(long, N) > 
   1.120  struct advance_forward
   1.121  {
   1.122      template< typename Iterator > struct apply
   1.123      {
   1.124          typedef typename apply_wrap1<
   1.125 -              advance_forward<4>
   1.126 +              advance_forward<BOOST_MPL_LIMIT_UNROLLING>
   1.127              , Iterator
   1.128              >::type chunk_result_;
   1.129  
   1.130          typedef typename apply_wrap1<
   1.131                advance_forward<(
   1.132 -                (N - 4) < 0
   1.133 +                (N - BOOST_MPL_LIMIT_UNROLLING) < 0
   1.134                      ? 0
   1.135 -                    : N - 4
   1.136 +                    : N - BOOST_MPL_LIMIT_UNROLLING
   1.137                      )>
   1.138              , chunk_result_
   1.139              >::type type;
   1.140 @@ -95,3 +74,50 @@
   1.141  
   1.142  }}}
   1.143  
   1.144 +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
   1.145 +#endif // BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
   1.146 +
   1.147 +///// iteration, depth == 1
   1.148 +
   1.149 +#elif BOOST_PP_ITERATION_DEPTH() == 1
   1.150 +#define i_ BOOST_PP_FRAME_ITERATION(1)
   1.151 +
   1.152 +template<>
   1.153 +struct advance_forward< BOOST_PP_FRAME_ITERATION(1) >
   1.154 +{
   1.155 +    template< typename Iterator > struct apply
   1.156 +    {
   1.157 +        typedef Iterator iter0;
   1.158 +
   1.159 +#if i_ > 0
   1.160 +#   define BOOST_PP_ITERATION_PARAMS_2 \
   1.161 +    (3,(1, i_, <boost/mpl/aux_/advance_forward.hpp>))
   1.162 +#   include BOOST_PP_ITERATE()
   1.163 +#endif
   1.164 +        typedef BOOST_PP_CAT(iter,i_) type;
   1.165 +    };
   1.166 +
   1.167 +#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
   1.168 +    /// ETI workaround
   1.169 +    template<> struct apply<int>
   1.170 +    {
   1.171 +        typedef int type;
   1.172 +    };
   1.173 +#endif
   1.174 +};
   1.175 +
   1.176 +#undef i_
   1.177 +
   1.178 +///// iteration, depth == 2
   1.179 +
   1.180 +#elif BOOST_PP_ITERATION_DEPTH() == 2
   1.181 +
   1.182 +#   define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
   1.183 +#   define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
   1.184 +
   1.185 +        typedef typename next<AUX778076_ITER_0>::type AUX778076_ITER_1;
   1.186 +        
   1.187 +#   undef AUX778076_ITER_1
   1.188 +#   undef AUX778076_ITER_0
   1.189 +
   1.190 +#endif // BOOST_PP_IS_ITERATING