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