1
//-----------------------------------------------------------------------------
2
// boost mpl/aux_/advance_forward.hpp header file
3
// See http://www.boost.org for updates, documentation, and revision history.
4
//-----------------------------------------------------------------------------
6
// Copyright (c) 2000-02
9
// Permission to use, copy, modify, distribute and sell this software
10
// and its documentation for any purpose is hereby granted without fee,
11
// provided that the above copyright notice appears in all copies and
12
// that both the copyright notice and this permission notice appear in
13
// supporting documentation. No representations are made about the
14
// suitability of this software for any purpose. It is provided "as is"
15
// without express or implied warranty.
17
#if !defined(BOOST_PP_IS_ITERATING)
21
#ifndef BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
22
#define BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
24
#include "boost/mpl/aux_/apply.hpp"
25
#include "boost/mpl/aux_/next.hpp"
26
#include "boost/mpl/aux_/config/eti.hpp"
28
#include "boost/mpl/aux_/config/use_preprocessed.hpp"
30
#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) && \
31
!defined(BOOST_MPL_PREPROCESSING_MODE)
33
# define BOOST_MPL_PREPROCESSED_HEADER advance_forward.hpp
34
# include "boost/mpl/aux_/include_preprocessed.hpp"
38
# include "boost/mpl/limits/unrolling.hpp"
39
# include "boost/mpl/aux_/config/nttp.hpp"
41
# include "boost/preprocessor/iterate.hpp"
42
# include "boost/preprocessor/cat.hpp"
43
# include "boost/preprocessor/inc.hpp"
49
// forward declaration
50
template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_forward;
52
# define BOOST_PP_ITERATION_PARAMS_1 \
53
(3,(0, BOOST_MPL_UNROLLING_LIMIT, "boost/mpl/aux_/advance_forward.hpp"))
54
# include BOOST_PP_ITERATE()
56
// implementation for N that exceeds BOOST_MPL_UNROLLING_LIMIT
57
template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
58
struct advance_forward
60
template< typename Iterator > struct apply
62
typedef typename BOOST_MPL_AUX_APPLY1(
63
advance_forward<BOOST_MPL_UNROLLING_LIMIT>
65
)::type chunk_result_;
67
typedef typename BOOST_MPL_AUX_APPLY1(
69
(N - BOOST_MPL_UNROLLING_LIMIT) < 0
71
: N - BOOST_MPL_UNROLLING_LIMIT
82
#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
83
#endif // BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
85
///// iteration, depth == 1
87
#elif BOOST_PP_ITERATION_DEPTH() == 1
88
#define i BOOST_PP_FRAME_ITERATION(1)
91
struct advance_forward< BOOST_PP_FRAME_ITERATION(1) >
93
template< typename Iterator > struct apply
95
typedef Iterator iter0;
98
# define BOOST_PP_ITERATION_PARAMS_2 \
99
(3,(1, i, "boost/mpl/aux_/advance_forward.hpp"))
100
# include BOOST_PP_ITERATE()
102
typedef BOOST_PP_CAT(iter,i) type;
105
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
107
template<> struct apply<int>
116
///// iteration, depth == 2
118
#elif BOOST_PP_ITERATION_DEPTH() == 2
120
# define AUX_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
121
# define AUX_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
123
typedef typename BOOST_MPL_AUX_NEXT(AUX_ITER_0) AUX_ITER_1;
128
#endif // BOOST_PP_IS_ITERATING