2 // Copyright Aleksey Gurtovoy 2000-2004
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
9 // *Preprocessed* version of the main "reverse_fold_impl.hpp" header
10 // -- DO NOT modify by hand!
12 namespace boost
{ namespace mpl
{ namespace aux
{
14 /// forward declaration
24 struct reverse_fold_impl
;
27 struct reverse_fold_chunk
;
29 template<> struct reverse_fold_chunk
<0>
41 typedef State fwd_state0
;
42 typedef fwd_state0 bkwd_state0
;
43 typedef bkwd_state0 state
;
44 typedef iter0 iterator
;
48 template<> struct reverse_fold_chunk
<1>
60 typedef State fwd_state0
;
61 typedef typename apply2
< ForwardOp
, fwd_state0
, typename deref
<iter0
>::type
>::type fwd_state1
;
62 typedef typename
mpl::next
<iter0
>::type iter1
;
65 typedef fwd_state1 bkwd_state1
;
66 typedef typename apply2
< BackwardOp
, bkwd_state1
, typename deref
<iter0
>::type
>::type bkwd_state0
;
67 typedef bkwd_state0 state
;
68 typedef iter1 iterator
;
72 template<> struct reverse_fold_chunk
<2>
84 typedef State fwd_state0
;
85 typedef typename apply2
< ForwardOp
, fwd_state0
, typename deref
<iter0
>::type
>::type fwd_state1
;
86 typedef typename
mpl::next
<iter0
>::type iter1
;
87 typedef typename apply2
< ForwardOp
, fwd_state1
, typename deref
<iter1
>::type
>::type fwd_state2
;
88 typedef typename
mpl::next
<iter1
>::type iter2
;
91 typedef fwd_state2 bkwd_state2
;
92 typedef typename apply2
< BackwardOp
, bkwd_state2
, typename deref
<iter1
>::type
>::type bkwd_state1
;
93 typedef typename apply2
< BackwardOp
, bkwd_state1
, typename deref
<iter0
>::type
>::type bkwd_state0
;
96 typedef bkwd_state0 state
;
97 typedef iter2 iterator
;
101 template<> struct reverse_fold_chunk
<3>
107 , typename BackwardOp
113 typedef State fwd_state0
;
114 typedef typename apply2
< ForwardOp
, fwd_state0
, typename deref
<iter0
>::type
>::type fwd_state1
;
115 typedef typename
mpl::next
<iter0
>::type iter1
;
116 typedef typename apply2
< ForwardOp
, fwd_state1
, typename deref
<iter1
>::type
>::type fwd_state2
;
117 typedef typename
mpl::next
<iter1
>::type iter2
;
118 typedef typename apply2
< ForwardOp
, fwd_state2
, typename deref
<iter2
>::type
>::type fwd_state3
;
119 typedef typename
mpl::next
<iter2
>::type iter3
;
122 typedef fwd_state3 bkwd_state3
;
123 typedef typename apply2
< BackwardOp
, bkwd_state3
, typename deref
<iter2
>::type
>::type bkwd_state2
;
124 typedef typename apply2
< BackwardOp
, bkwd_state2
, typename deref
<iter1
>::type
>::type bkwd_state1
;
125 typedef typename apply2
< BackwardOp
, bkwd_state1
, typename deref
<iter0
>::type
>::type bkwd_state0
;
128 typedef bkwd_state0 state
;
129 typedef iter3 iterator
;
133 template<> struct reverse_fold_chunk
<4>
139 , typename BackwardOp
145 typedef State fwd_state0
;
146 typedef typename apply2
< ForwardOp
, fwd_state0
, typename deref
<iter0
>::type
>::type fwd_state1
;
147 typedef typename
mpl::next
<iter0
>::type iter1
;
148 typedef typename apply2
< ForwardOp
, fwd_state1
, typename deref
<iter1
>::type
>::type fwd_state2
;
149 typedef typename
mpl::next
<iter1
>::type iter2
;
150 typedef typename apply2
< ForwardOp
, fwd_state2
, typename deref
<iter2
>::type
>::type fwd_state3
;
151 typedef typename
mpl::next
<iter2
>::type iter3
;
152 typedef typename apply2
< ForwardOp
, fwd_state3
, typename deref
<iter3
>::type
>::type fwd_state4
;
153 typedef typename
mpl::next
<iter3
>::type iter4
;
156 typedef fwd_state4 bkwd_state4
;
157 typedef typename apply2
< BackwardOp
, bkwd_state4
, typename deref
<iter3
>::type
>::type bkwd_state3
;
158 typedef typename apply2
< BackwardOp
, bkwd_state3
, typename deref
<iter2
>::type
>::type bkwd_state2
;
159 typedef typename apply2
< BackwardOp
, bkwd_state2
, typename deref
<iter1
>::type
>::type bkwd_state1
;
160 typedef typename apply2
< BackwardOp
, bkwd_state1
, typename deref
<iter0
>::type
>::type bkwd_state0
;
163 typedef bkwd_state0 state
;
164 typedef iter4 iterator
;
169 struct reverse_fold_chunk
175 , typename BackwardOp
181 typedef State fwd_state0
;
182 typedef typename apply2
< ForwardOp
, fwd_state0
, typename deref
<iter0
>::type
>::type fwd_state1
;
183 typedef typename
mpl::next
<iter0
>::type iter1
;
184 typedef typename apply2
< ForwardOp
, fwd_state1
, typename deref
<iter1
>::type
>::type fwd_state2
;
185 typedef typename
mpl::next
<iter1
>::type iter2
;
186 typedef typename apply2
< ForwardOp
, fwd_state2
, typename deref
<iter2
>::type
>::type fwd_state3
;
187 typedef typename
mpl::next
<iter2
>::type iter3
;
188 typedef typename apply2
< ForwardOp
, fwd_state3
, typename deref
<iter3
>::type
>::type fwd_state4
;
189 typedef typename
mpl::next
<iter3
>::type iter4
;
192 typedef reverse_fold_impl
<
193 ( (N
- 4) < 0 ? 0 : N
- 4 )
201 typedef typename
nested_chunk::state bkwd_state4
;
202 typedef typename apply2
< BackwardOp
, bkwd_state4
, typename deref
<iter3
>::type
>::type bkwd_state3
;
203 typedef typename apply2
< BackwardOp
, bkwd_state3
, typename deref
<iter2
>::type
>::type bkwd_state2
;
204 typedef typename apply2
< BackwardOp
, bkwd_state2
, typename deref
<iter1
>::type
>::type bkwd_state1
;
205 typedef typename apply2
< BackwardOp
, bkwd_state1
, typename deref
<iter0
>::type
>::type bkwd_state0
;
208 typedef bkwd_state0 state
;
209 typedef typename
nested_chunk::iterator iterator
;
217 , typename BackwardOp
220 struct reverse_fold_step
;
226 struct reverse_fold_null_step
228 typedef Last iterator
;
233 struct reverse_fold_chunk
< -1 >
239 , typename BackwardOp
244 typedef typename if_
<
245 typename is_same
< First
,Last
>::type
246 , reverse_fold_null_step
< Last
,State
>
247 , reverse_fold_step
< First
,Last
,State
,BackwardOp
,ForwardOp
>
250 typedef typename
res_::state state
;
251 typedef typename
res_::iterator iterator
;
259 , typename BackwardOp
262 struct reverse_fold_step
264 typedef reverse_fold_chunk
< -1 >::template result_
<
265 typename
mpl::next
<First
>::type
267 , typename apply2
<ForwardOp
,State
, typename deref
<First
>::type
>::type
272 typedef typename apply2
<
274 , typename
nested_step::state
275 , typename deref
<First
>::type
278 typedef typename
nested_step::iterator iterator
;
286 , typename BackwardOp
289 struct reverse_fold_impl
290 : reverse_fold_chunk
<N
>
291 ::template result_
< First
,Last
,State
,BackwardOp
,ForwardOp
>