Chris@16
|
1 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
2 /// \file and_n.hpp
|
Chris@16
|
3 /// Definitions of and_N, and_impl
|
Chris@16
|
4 //
|
Chris@16
|
5 // Copyright 2008 Eric Niebler. Distributed under the Boost
|
Chris@16
|
6 // Software License, Version 1.0. (See accompanying file
|
Chris@16
|
7 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8
|
Chris@16
|
9
|
Chris@16
|
10
|
Chris@16
|
11 template<bool B, typename P0>
|
Chris@16
|
12 struct and_2
|
Chris@16
|
13 : mpl::bool_<P0::value>
|
Chris@16
|
14 {};
|
Chris@16
|
15 template<typename P0>
|
Chris@16
|
16 struct and_2<false, P0>
|
Chris@16
|
17 : mpl::false_
|
Chris@16
|
18 {};
|
Chris@16
|
19 template<typename G0 , typename G1, typename Expr, typename State, typename Data>
|
Chris@16
|
20 struct _and_impl<proto::and_<G0 , G1>, Expr, State, Data>
|
Chris@16
|
21 : proto::transform_impl<Expr, State, Data>
|
Chris@16
|
22 {
|
Chris@16
|
23 typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1;
|
Chris@16
|
24 typedef typename Gimpl1::result_type result_type;
|
Chris@16
|
25 result_type operator()(
|
Chris@16
|
26 typename _and_impl::expr_param e
|
Chris@16
|
27 , typename _and_impl::state_param s
|
Chris@16
|
28 , typename _and_impl::data_param d
|
Chris@16
|
29 ) const
|
Chris@16
|
30 {
|
Chris@16
|
31
|
Chris@16
|
32
|
Chris@16
|
33
|
Chris@16
|
34
|
Chris@16
|
35 Gimpl0()(e,s,d);
|
Chris@16
|
36 return Gimpl1()(e,s,d);
|
Chris@16
|
37 }
|
Chris@16
|
38 };
|
Chris@16
|
39
|
Chris@16
|
40
|
Chris@16
|
41
|
Chris@16
|
42 template<bool B, typename P0 , typename P1>
|
Chris@16
|
43 struct and_3
|
Chris@16
|
44 : and_2<
|
Chris@16
|
45 P0::value ,
|
Chris@16
|
46 P1
|
Chris@16
|
47 >
|
Chris@16
|
48 {};
|
Chris@16
|
49 template<typename P0 , typename P1>
|
Chris@16
|
50 struct and_3<false, P0 , P1>
|
Chris@16
|
51 : mpl::false_
|
Chris@16
|
52 {};
|
Chris@16
|
53 template<typename G0 , typename G1 , typename G2, typename Expr, typename State, typename Data>
|
Chris@16
|
54 struct _and_impl<proto::and_<G0 , G1 , G2>, Expr, State, Data>
|
Chris@16
|
55 : proto::transform_impl<Expr, State, Data>
|
Chris@16
|
56 {
|
Chris@16
|
57 typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2;
|
Chris@16
|
58 typedef typename Gimpl2::result_type result_type;
|
Chris@16
|
59 result_type operator()(
|
Chris@16
|
60 typename _and_impl::expr_param e
|
Chris@16
|
61 , typename _and_impl::state_param s
|
Chris@16
|
62 , typename _and_impl::data_param d
|
Chris@16
|
63 ) const
|
Chris@16
|
64 {
|
Chris@16
|
65
|
Chris@16
|
66
|
Chris@16
|
67
|
Chris@16
|
68
|
Chris@16
|
69 Gimpl0()(e,s,d); Gimpl1()(e,s,d);
|
Chris@16
|
70 return Gimpl2()(e,s,d);
|
Chris@16
|
71 }
|
Chris@16
|
72 };
|
Chris@16
|
73
|
Chris@16
|
74
|
Chris@16
|
75
|
Chris@16
|
76 template<bool B, typename P0 , typename P1 , typename P2>
|
Chris@16
|
77 struct and_4
|
Chris@16
|
78 : and_3<
|
Chris@16
|
79 P0::value ,
|
Chris@16
|
80 P1 , P2
|
Chris@16
|
81 >
|
Chris@16
|
82 {};
|
Chris@16
|
83 template<typename P0 , typename P1 , typename P2>
|
Chris@16
|
84 struct and_4<false, P0 , P1 , P2>
|
Chris@16
|
85 : mpl::false_
|
Chris@16
|
86 {};
|
Chris@16
|
87 template<typename G0 , typename G1 , typename G2 , typename G3, typename Expr, typename State, typename Data>
|
Chris@16
|
88 struct _and_impl<proto::and_<G0 , G1 , G2 , G3>, Expr, State, Data>
|
Chris@16
|
89 : proto::transform_impl<Expr, State, Data>
|
Chris@16
|
90 {
|
Chris@16
|
91 typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3;
|
Chris@16
|
92 typedef typename Gimpl3::result_type result_type;
|
Chris@16
|
93 result_type operator()(
|
Chris@16
|
94 typename _and_impl::expr_param e
|
Chris@16
|
95 , typename _and_impl::state_param s
|
Chris@16
|
96 , typename _and_impl::data_param d
|
Chris@16
|
97 ) const
|
Chris@16
|
98 {
|
Chris@16
|
99
|
Chris@16
|
100
|
Chris@16
|
101
|
Chris@16
|
102
|
Chris@16
|
103 Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d);
|
Chris@16
|
104 return Gimpl3()(e,s,d);
|
Chris@16
|
105 }
|
Chris@16
|
106 };
|
Chris@16
|
107
|
Chris@16
|
108
|
Chris@16
|
109
|
Chris@16
|
110 template<bool B, typename P0 , typename P1 , typename P2 , typename P3>
|
Chris@16
|
111 struct and_5
|
Chris@16
|
112 : and_4<
|
Chris@16
|
113 P0::value ,
|
Chris@16
|
114 P1 , P2 , P3
|
Chris@16
|
115 >
|
Chris@16
|
116 {};
|
Chris@16
|
117 template<typename P0 , typename P1 , typename P2 , typename P3>
|
Chris@16
|
118 struct and_5<false, P0 , P1 , P2 , P3>
|
Chris@16
|
119 : mpl::false_
|
Chris@16
|
120 {};
|
Chris@16
|
121 template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4, typename Expr, typename State, typename Data>
|
Chris@16
|
122 struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4>, Expr, State, Data>
|
Chris@16
|
123 : proto::transform_impl<Expr, State, Data>
|
Chris@16
|
124 {
|
Chris@16
|
125 typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4;
|
Chris@16
|
126 typedef typename Gimpl4::result_type result_type;
|
Chris@16
|
127 result_type operator()(
|
Chris@16
|
128 typename _and_impl::expr_param e
|
Chris@16
|
129 , typename _and_impl::state_param s
|
Chris@16
|
130 , typename _and_impl::data_param d
|
Chris@16
|
131 ) const
|
Chris@16
|
132 {
|
Chris@16
|
133
|
Chris@16
|
134
|
Chris@16
|
135
|
Chris@16
|
136
|
Chris@16
|
137 Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d);
|
Chris@16
|
138 return Gimpl4()(e,s,d);
|
Chris@16
|
139 }
|
Chris@16
|
140 };
|
Chris@16
|
141
|
Chris@16
|
142
|
Chris@16
|
143
|
Chris@16
|
144 template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4>
|
Chris@16
|
145 struct and_6
|
Chris@16
|
146 : and_5<
|
Chris@16
|
147 P0::value ,
|
Chris@16
|
148 P1 , P2 , P3 , P4
|
Chris@16
|
149 >
|
Chris@16
|
150 {};
|
Chris@16
|
151 template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4>
|
Chris@16
|
152 struct and_6<false, P0 , P1 , P2 , P3 , P4>
|
Chris@16
|
153 : mpl::false_
|
Chris@16
|
154 {};
|
Chris@16
|
155 template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5, typename Expr, typename State, typename Data>
|
Chris@16
|
156 struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5>, Expr, State, Data>
|
Chris@16
|
157 : proto::transform_impl<Expr, State, Data>
|
Chris@16
|
158 {
|
Chris@16
|
159 typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5;
|
Chris@16
|
160 typedef typename Gimpl5::result_type result_type;
|
Chris@16
|
161 result_type operator()(
|
Chris@16
|
162 typename _and_impl::expr_param e
|
Chris@16
|
163 , typename _and_impl::state_param s
|
Chris@16
|
164 , typename _and_impl::data_param d
|
Chris@16
|
165 ) const
|
Chris@16
|
166 {
|
Chris@16
|
167
|
Chris@16
|
168
|
Chris@16
|
169
|
Chris@16
|
170
|
Chris@16
|
171 Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d);
|
Chris@16
|
172 return Gimpl5()(e,s,d);
|
Chris@16
|
173 }
|
Chris@16
|
174 };
|
Chris@16
|
175
|
Chris@16
|
176
|
Chris@16
|
177
|
Chris@16
|
178 template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5>
|
Chris@16
|
179 struct and_7
|
Chris@16
|
180 : and_6<
|
Chris@16
|
181 P0::value ,
|
Chris@16
|
182 P1 , P2 , P3 , P4 , P5
|
Chris@16
|
183 >
|
Chris@16
|
184 {};
|
Chris@16
|
185 template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5>
|
Chris@16
|
186 struct and_7<false, P0 , P1 , P2 , P3 , P4 , P5>
|
Chris@16
|
187 : mpl::false_
|
Chris@16
|
188 {};
|
Chris@16
|
189 template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6, typename Expr, typename State, typename Data>
|
Chris@16
|
190 struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6>, Expr, State, Data>
|
Chris@16
|
191 : proto::transform_impl<Expr, State, Data>
|
Chris@16
|
192 {
|
Chris@16
|
193 typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6;
|
Chris@16
|
194 typedef typename Gimpl6::result_type result_type;
|
Chris@16
|
195 result_type operator()(
|
Chris@16
|
196 typename _and_impl::expr_param e
|
Chris@16
|
197 , typename _and_impl::state_param s
|
Chris@16
|
198 , typename _and_impl::data_param d
|
Chris@16
|
199 ) const
|
Chris@16
|
200 {
|
Chris@16
|
201
|
Chris@16
|
202
|
Chris@16
|
203
|
Chris@16
|
204
|
Chris@16
|
205 Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d);
|
Chris@16
|
206 return Gimpl6()(e,s,d);
|
Chris@16
|
207 }
|
Chris@16
|
208 };
|
Chris@16
|
209
|
Chris@16
|
210
|
Chris@16
|
211
|
Chris@16
|
212 template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6>
|
Chris@16
|
213 struct and_8
|
Chris@16
|
214 : and_7<
|
Chris@16
|
215 P0::value ,
|
Chris@16
|
216 P1 , P2 , P3 , P4 , P5 , P6
|
Chris@16
|
217 >
|
Chris@16
|
218 {};
|
Chris@16
|
219 template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6>
|
Chris@16
|
220 struct and_8<false, P0 , P1 , P2 , P3 , P4 , P5 , P6>
|
Chris@16
|
221 : mpl::false_
|
Chris@16
|
222 {};
|
Chris@16
|
223 template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7, typename Expr, typename State, typename Data>
|
Chris@16
|
224 struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7>, Expr, State, Data>
|
Chris@16
|
225 : proto::transform_impl<Expr, State, Data>
|
Chris@16
|
226 {
|
Chris@16
|
227 typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6; typedef typename proto::when<proto::_, G7> ::template impl<Expr, State, Data> Gimpl7;
|
Chris@16
|
228 typedef typename Gimpl7::result_type result_type;
|
Chris@16
|
229 result_type operator()(
|
Chris@16
|
230 typename _and_impl::expr_param e
|
Chris@16
|
231 , typename _and_impl::state_param s
|
Chris@16
|
232 , typename _and_impl::data_param d
|
Chris@16
|
233 ) const
|
Chris@16
|
234 {
|
Chris@16
|
235
|
Chris@16
|
236
|
Chris@16
|
237
|
Chris@16
|
238
|
Chris@16
|
239 Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d); Gimpl6()(e,s,d);
|
Chris@16
|
240 return Gimpl7()(e,s,d);
|
Chris@16
|
241 }
|
Chris@16
|
242 };
|
Chris@16
|
243
|
Chris@16
|
244
|
Chris@16
|
245
|
Chris@16
|
246 template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7>
|
Chris@16
|
247 struct and_9
|
Chris@16
|
248 : and_8<
|
Chris@16
|
249 P0::value ,
|
Chris@16
|
250 P1 , P2 , P3 , P4 , P5 , P6 , P7
|
Chris@16
|
251 >
|
Chris@16
|
252 {};
|
Chris@16
|
253 template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7>
|
Chris@16
|
254 struct and_9<false, P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7>
|
Chris@16
|
255 : mpl::false_
|
Chris@16
|
256 {};
|
Chris@16
|
257 template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8, typename Expr, typename State, typename Data>
|
Chris@16
|
258 struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8>, Expr, State, Data>
|
Chris@16
|
259 : proto::transform_impl<Expr, State, Data>
|
Chris@16
|
260 {
|
Chris@16
|
261 typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6; typedef typename proto::when<proto::_, G7> ::template impl<Expr, State, Data> Gimpl7; typedef typename proto::when<proto::_, G8> ::template impl<Expr, State, Data> Gimpl8;
|
Chris@16
|
262 typedef typename Gimpl8::result_type result_type;
|
Chris@16
|
263 result_type operator()(
|
Chris@16
|
264 typename _and_impl::expr_param e
|
Chris@16
|
265 , typename _and_impl::state_param s
|
Chris@16
|
266 , typename _and_impl::data_param d
|
Chris@16
|
267 ) const
|
Chris@16
|
268 {
|
Chris@16
|
269
|
Chris@16
|
270
|
Chris@16
|
271
|
Chris@16
|
272
|
Chris@16
|
273 Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d); Gimpl6()(e,s,d); Gimpl7()(e,s,d);
|
Chris@16
|
274 return Gimpl8()(e,s,d);
|
Chris@16
|
275 }
|
Chris@16
|
276 };
|
Chris@16
|
277
|
Chris@16
|
278
|
Chris@16
|
279
|
Chris@16
|
280 template<bool B, typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8>
|
Chris@16
|
281 struct and_10
|
Chris@16
|
282 : and_9<
|
Chris@16
|
283 P0::value ,
|
Chris@16
|
284 P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8
|
Chris@16
|
285 >
|
Chris@16
|
286 {};
|
Chris@16
|
287 template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8>
|
Chris@16
|
288 struct and_10<false, P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8>
|
Chris@16
|
289 : mpl::false_
|
Chris@16
|
290 {};
|
Chris@16
|
291 template<typename G0 , typename G1 , typename G2 , typename G3 , typename G4 , typename G5 , typename G6 , typename G7 , typename G8 , typename G9, typename Expr, typename State, typename Data>
|
Chris@16
|
292 struct _and_impl<proto::and_<G0 , G1 , G2 , G3 , G4 , G5 , G6 , G7 , G8 , G9>, Expr, State, Data>
|
Chris@16
|
293 : proto::transform_impl<Expr, State, Data>
|
Chris@16
|
294 {
|
Chris@16
|
295 typedef typename proto::when<proto::_, G0> ::template impl<Expr, State, Data> Gimpl0; typedef typename proto::when<proto::_, G1> ::template impl<Expr, State, Data> Gimpl1; typedef typename proto::when<proto::_, G2> ::template impl<Expr, State, Data> Gimpl2; typedef typename proto::when<proto::_, G3> ::template impl<Expr, State, Data> Gimpl3; typedef typename proto::when<proto::_, G4> ::template impl<Expr, State, Data> Gimpl4; typedef typename proto::when<proto::_, G5> ::template impl<Expr, State, Data> Gimpl5; typedef typename proto::when<proto::_, G6> ::template impl<Expr, State, Data> Gimpl6; typedef typename proto::when<proto::_, G7> ::template impl<Expr, State, Data> Gimpl7; typedef typename proto::when<proto::_, G8> ::template impl<Expr, State, Data> Gimpl8; typedef typename proto::when<proto::_, G9> ::template impl<Expr, State, Data> Gimpl9;
|
Chris@16
|
296 typedef typename Gimpl9::result_type result_type;
|
Chris@16
|
297 result_type operator()(
|
Chris@16
|
298 typename _and_impl::expr_param e
|
Chris@16
|
299 , typename _and_impl::state_param s
|
Chris@16
|
300 , typename _and_impl::data_param d
|
Chris@16
|
301 ) const
|
Chris@16
|
302 {
|
Chris@16
|
303
|
Chris@16
|
304
|
Chris@16
|
305
|
Chris@16
|
306
|
Chris@16
|
307 Gimpl0()(e,s,d); Gimpl1()(e,s,d); Gimpl2()(e,s,d); Gimpl3()(e,s,d); Gimpl4()(e,s,d); Gimpl5()(e,s,d); Gimpl6()(e,s,d); Gimpl7()(e,s,d); Gimpl8()(e,s,d);
|
Chris@16
|
308 return Gimpl9()(e,s,d);
|
Chris@16
|
309 }
|
Chris@16
|
310 };
|