2 #if !defined(BOOST_PP_IS_ITERATING)
\r
6 #ifndef BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
\r
7 #define BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
\r
9 // Copyright Aleksey Gurtovoy 2000-2004
\r
11 // Distributed under the Boost Software License, Version 1.0.
\r
12 // (See accompanying file LICENSE_1_0.txt or copy at
\r
13 // http://www.boost.org/LICENSE_1_0.txt)
\r
15 // See http://www.boost.org/libs/mpl for documentation.
\r
17 // $Id: advance_forward.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
\r
18 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
\r
19 // $Revision: 49267 $
\r
21 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
\r
22 # include <boost/mpl/next.hpp>
\r
23 # include <boost/mpl/apply_wrap.hpp>
\r
26 #include <boost/mpl/aux_/config/use_preprocessed.hpp>
\r
28 #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
\r
29 && !defined(BOOST_MPL_PREPROCESSING_MODE)
\r
31 # define BOOST_MPL_PREPROCESSED_HEADER advance_forward.hpp
\r
32 # include <boost/mpl/aux_/include_preprocessed.hpp>
\r
36 # include <boost/mpl/limits/unrolling.hpp>
\r
37 # include <boost/mpl/aux_/nttp_decl.hpp>
\r
38 # include <boost/mpl/aux_/config/eti.hpp>
\r
40 # include <boost/preprocessor/iterate.hpp>
\r
41 # include <boost/preprocessor/cat.hpp>
\r
42 # include <boost/preprocessor/inc.hpp>
\r
44 namespace boost { namespace mpl { namespace aux {
\r
46 // forward declaration
\r
47 template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_forward;
\r
49 # define BOOST_PP_ITERATION_PARAMS_1 \
\r
50 (3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_forward.hpp>))
\r
51 # include BOOST_PP_ITERATE()
\r
53 // implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING
\r
54 template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
\r
55 struct advance_forward
\r
57 template< typename Iterator > struct apply
\r
59 typedef typename apply_wrap1<
\r
60 advance_forward<BOOST_MPL_LIMIT_UNROLLING>
\r
62 >::type chunk_result_;
\r
64 typedef typename apply_wrap1<
\r
66 (N - BOOST_MPL_LIMIT_UNROLLING) < 0
\r
68 : N - BOOST_MPL_LIMIT_UNROLLING
\r
77 #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
\r
78 #endif // BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
\r
80 ///// iteration, depth == 1
\r
82 // For gcc 4.4 compatability, we must include the
\r
83 // BOOST_PP_ITERATION_DEPTH test inside an #else clause.
\r
84 #else // BOOST_PP_IS_ITERATING
\r
85 #if BOOST_PP_ITERATION_DEPTH() == 1
\r
86 #define i_ BOOST_PP_FRAME_ITERATION(1)
\r
89 struct advance_forward< BOOST_PP_FRAME_ITERATION(1) >
\r
91 template< typename Iterator > struct apply
\r
93 typedef Iterator iter0;
\r
96 # define BOOST_PP_ITERATION_PARAMS_2 \
\r
97 (3,(1, i_, <boost/mpl/aux_/advance_forward.hpp>))
\r
98 # include BOOST_PP_ITERATE()
\r
100 typedef BOOST_PP_CAT(iter,i_) type;
\r
103 #if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
\r
105 template<> struct apply<int>
\r
114 ///// iteration, depth == 2
\r
116 #elif BOOST_PP_ITERATION_DEPTH() == 2
\r
118 # define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
\r
119 # define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
\r
121 typedef typename next<AUX778076_ITER_0>::type AUX778076_ITER_1;
\r
123 # undef AUX778076_ITER_1
\r
124 # undef AUX778076_ITER_0
\r
126 #endif // BOOST_PP_ITERATION_DEPTH()
\r
127 #endif // BOOST_PP_IS_ITERATING
\r