Fixes for VS 2008
[dyninst.git] / external / boost / mpl / aux_ / preprocessed / no_ttp / reverse_iter_fold_impl.hpp
1 \r
2 // Copyright Aleksey Gurtovoy 2000-2004\r
3 //\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
7 //\r
8 \r
9 // Preprocessed version of "boost/mpl/aux_/reverse_iter_fold_impl.hpp" header\r
10 // -- DO NOT modify by hand!\r
11 \r
12 namespace boost { namespace mpl { namespace aux {\r
13 \r
14 /// forward declaration\r
15 \r
16 template<\r
17       long N\r
18     , typename First\r
19     , typename Last\r
20     , typename State\r
21     , typename BackwardOp\r
22     , typename ForwardOp\r
23     >\r
24 struct reverse_iter_fold_impl;\r
25 \r
26 template<\r
27       typename First\r
28     , typename Last\r
29     , typename State\r
30     , typename BackwardOp\r
31     , typename ForwardOp\r
32     >\r
33 struct reverse_iter_fold_impl< 0,First,Last,State,BackwardOp,ForwardOp >\r
34 {\r
35     typedef First iter0;\r
36     typedef State fwd_state0;\r
37     typedef fwd_state0 bkwd_state0;\r
38     typedef bkwd_state0 state;\r
39     typedef iter0 iterator;\r
40 };\r
41 \r
42 template<\r
43       typename First\r
44     , typename Last\r
45     , typename State\r
46     , typename BackwardOp\r
47     , typename ForwardOp\r
48     >\r
49 struct reverse_iter_fold_impl< 1,First,Last,State,BackwardOp,ForwardOp >\r
50 {\r
51     typedef First iter0;\r
52     typedef State fwd_state0;\r
53     typedef typename apply2< ForwardOp,fwd_state0,iter0 >::type fwd_state1;\r
54     typedef typename mpl::next<iter0>::type iter1;\r
55     \r
56 \r
57     typedef fwd_state1 bkwd_state1;\r
58     typedef typename apply2< BackwardOp,bkwd_state1,iter0 >::type bkwd_state0;\r
59     typedef bkwd_state0 state;\r
60     typedef iter1 iterator;\r
61 };\r
62 \r
63 template<\r
64       typename First\r
65     , typename Last\r
66     , typename State\r
67     , typename BackwardOp\r
68     , typename ForwardOp\r
69     >\r
70 struct reverse_iter_fold_impl< 2,First,Last,State,BackwardOp,ForwardOp >\r
71 {\r
72     typedef First iter0;\r
73     typedef State fwd_state0;\r
74     typedef typename apply2< ForwardOp,fwd_state0,iter0 >::type fwd_state1;\r
75     typedef typename mpl::next<iter0>::type iter1;\r
76     typedef typename apply2< ForwardOp,fwd_state1,iter1 >::type fwd_state2;\r
77     typedef typename mpl::next<iter1>::type iter2;\r
78     \r
79 \r
80     typedef fwd_state2 bkwd_state2;\r
81     typedef typename apply2< BackwardOp,bkwd_state2,iter1 >::type bkwd_state1;\r
82     typedef typename apply2< BackwardOp,bkwd_state1,iter0 >::type bkwd_state0;\r
83     \r
84 \r
85     typedef bkwd_state0 state;\r
86     typedef iter2 iterator;\r
87 };\r
88 \r
89 template<\r
90       typename First\r
91     , typename Last\r
92     , typename State\r
93     , typename BackwardOp\r
94     , typename ForwardOp\r
95     >\r
96 struct reverse_iter_fold_impl< 3,First,Last,State,BackwardOp,ForwardOp >\r
97 {\r
98     typedef First iter0;\r
99     typedef State fwd_state0;\r
100     typedef typename apply2< ForwardOp,fwd_state0,iter0 >::type fwd_state1;\r
101     typedef typename mpl::next<iter0>::type iter1;\r
102     typedef typename apply2< ForwardOp,fwd_state1,iter1 >::type fwd_state2;\r
103     typedef typename mpl::next<iter1>::type iter2;\r
104     typedef typename apply2< ForwardOp,fwd_state2,iter2 >::type fwd_state3;\r
105     typedef typename mpl::next<iter2>::type iter3;\r
106     \r
107 \r
108     typedef fwd_state3 bkwd_state3;\r
109     typedef typename apply2< BackwardOp,bkwd_state3,iter2 >::type bkwd_state2;\r
110     typedef typename apply2< BackwardOp,bkwd_state2,iter1 >::type bkwd_state1;\r
111     typedef typename apply2< BackwardOp,bkwd_state1,iter0 >::type bkwd_state0;\r
112     \r
113 \r
114     typedef bkwd_state0 state;\r
115     typedef iter3 iterator;\r
116 };\r
117 \r
118 template<\r
119       typename First\r
120     , typename Last\r
121     , typename State\r
122     , typename BackwardOp\r
123     , typename ForwardOp\r
124     >\r
125 struct reverse_iter_fold_impl< 4,First,Last,State,BackwardOp,ForwardOp >\r
126 {\r
127     typedef First iter0;\r
128     typedef State fwd_state0;\r
129     typedef typename apply2< ForwardOp,fwd_state0,iter0 >::type fwd_state1;\r
130     typedef typename mpl::next<iter0>::type iter1;\r
131     typedef typename apply2< ForwardOp,fwd_state1,iter1 >::type fwd_state2;\r
132     typedef typename mpl::next<iter1>::type iter2;\r
133     typedef typename apply2< ForwardOp,fwd_state2,iter2 >::type fwd_state3;\r
134     typedef typename mpl::next<iter2>::type iter3;\r
135     typedef typename apply2< ForwardOp,fwd_state3,iter3 >::type fwd_state4;\r
136     typedef typename mpl::next<iter3>::type iter4;\r
137     \r
138 \r
139     typedef fwd_state4 bkwd_state4;\r
140     typedef typename apply2< BackwardOp,bkwd_state4,iter3 >::type bkwd_state3;\r
141     typedef typename apply2< BackwardOp,bkwd_state3,iter2 >::type bkwd_state2;\r
142     typedef typename apply2< BackwardOp,bkwd_state2,iter1 >::type bkwd_state1;\r
143     typedef typename apply2< BackwardOp,bkwd_state1,iter0 >::type bkwd_state0;\r
144     \r
145 \r
146     typedef bkwd_state0 state;\r
147     typedef iter4 iterator;\r
148 };\r
149 \r
150 template<\r
151       long N\r
152     , typename First\r
153     , typename Last\r
154     , typename State\r
155     , typename BackwardOp\r
156     , typename ForwardOp\r
157     >\r
158 struct reverse_iter_fold_impl\r
159 {\r
160     typedef First iter0;\r
161     typedef State fwd_state0;\r
162     typedef typename apply2< ForwardOp,fwd_state0,iter0 >::type fwd_state1;\r
163     typedef typename mpl::next<iter0>::type iter1;\r
164     typedef typename apply2< ForwardOp,fwd_state1,iter1 >::type fwd_state2;\r
165     typedef typename mpl::next<iter1>::type iter2;\r
166     typedef typename apply2< ForwardOp,fwd_state2,iter2 >::type fwd_state3;\r
167     typedef typename mpl::next<iter2>::type iter3;\r
168     typedef typename apply2< ForwardOp,fwd_state3,iter3 >::type fwd_state4;\r
169     typedef typename mpl::next<iter3>::type iter4;\r
170     \r
171 \r
172     typedef reverse_iter_fold_impl<\r
173           ( (N - 4) < 0 ? 0 : N - 4 )\r
174         , iter4\r
175         , Last\r
176         , fwd_state4\r
177         , BackwardOp\r
178         , ForwardOp\r
179         > nested_chunk;\r
180 \r
181     typedef typename nested_chunk::state bkwd_state4;\r
182     typedef typename apply2< BackwardOp,bkwd_state4,iter3 >::type bkwd_state3;\r
183     typedef typename apply2< BackwardOp,bkwd_state3,iter2 >::type bkwd_state2;\r
184     typedef typename apply2< BackwardOp,bkwd_state2,iter1 >::type bkwd_state1;\r
185     typedef typename apply2< BackwardOp,bkwd_state1,iter0 >::type bkwd_state0;\r
186     \r
187 \r
188     typedef bkwd_state0 state;\r
189     typedef typename nested_chunk::iterator iterator;\r
190 };\r
191 \r
192 template<\r
193       typename First\r
194     , typename Last\r
195     , typename State\r
196     , typename BackwardOp\r
197     , typename ForwardOp\r
198     >\r
199 struct reverse_iter_fold_impl< -1,First,Last,State,BackwardOp,ForwardOp >\r
200 {\r
201     typedef reverse_iter_fold_impl<\r
202           -1\r
203         , typename mpl::next<First>::type\r
204         , Last\r
205         , typename apply2< ForwardOp,State,First >::type\r
206         , BackwardOp\r
207         , ForwardOp\r
208         > nested_step;\r
209 \r
210     typedef typename apply2<\r
211           BackwardOp\r
212         , typename nested_step::state\r
213         , First\r
214         >::type state;\r
215 \r
216     typedef typename nested_step::iterator iterator;\r
217 };\r
218 \r
219 template<\r
220       typename Last\r
221     , typename State\r
222     , typename BackwardOp\r
223     , typename ForwardOp\r
224     >\r
225 struct reverse_iter_fold_impl< -1,Last,Last,State,BackwardOp,ForwardOp >\r
226 {\r
227     typedef State state;\r
228     typedef Last iterator;\r
229 };\r
230 \r
231 }}}\r