Chris@16
|
1 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
2 /// \file callable_eval.hpp
|
Chris@16
|
3 /// Contains specializations of the callable_eval\<\> class template.
|
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 namespace detail
|
Chris@16
|
9 {
|
Chris@16
|
10 template<typename Expr, typename Context>
|
Chris@16
|
11 struct is_expr_handled<Expr, Context, 1>
|
Chris@16
|
12 {
|
Chris@16
|
13 static callable_context_wrapper<Context> &sctx_;
|
Chris@16
|
14 static Expr &sexpr_;
|
Chris@16
|
15 static typename Expr::proto_tag &stag_;
|
Chris@16
|
16 static const bool value =
|
Chris@16
|
17 sizeof(yes_type) ==
|
Chris@16
|
18 sizeof(
|
Chris@16
|
19 detail::check_is_expr_handled(
|
Chris@16
|
20 (sctx_(
|
Chris@16
|
21 stag_
|
Chris@16
|
22 , proto::child_c< 0>( sexpr_)
|
Chris@16
|
23 ), 0)
|
Chris@16
|
24 )
|
Chris@16
|
25 );
|
Chris@16
|
26 typedef mpl::bool_<value> type;
|
Chris@16
|
27 };
|
Chris@16
|
28 }
|
Chris@16
|
29 namespace context
|
Chris@16
|
30 {
|
Chris@16
|
31
|
Chris@16
|
32
|
Chris@16
|
33
|
Chris@16
|
34
|
Chris@16
|
35
|
Chris@16
|
36
|
Chris@16
|
37
|
Chris@16
|
38
|
Chris@16
|
39
|
Chris@16
|
40
|
Chris@16
|
41
|
Chris@16
|
42
|
Chris@16
|
43 template<typename Expr, typename Context>
|
Chris@16
|
44 struct callable_eval<Expr, Context, 1>
|
Chris@16
|
45 {
|
Chris@16
|
46 typedef typename proto::result_of::child_c< Expr const &, 0>::type child0;
|
Chris@16
|
47 typedef
|
Chris@16
|
48 typename BOOST_PROTO_RESULT_OF<
|
Chris@16
|
49 Context(
|
Chris@16
|
50 typename Expr::proto_tag
|
Chris@16
|
51 , child0
|
Chris@16
|
52 )
|
Chris@16
|
53 >::type
|
Chris@16
|
54 result_type;
|
Chris@16
|
55
|
Chris@16
|
56
|
Chris@16
|
57
|
Chris@16
|
58 result_type operator ()(Expr &expr, Context &context) const
|
Chris@16
|
59 {
|
Chris@16
|
60 return context(
|
Chris@16
|
61 typename Expr::proto_tag()
|
Chris@16
|
62 , proto::child_c< 0>( expr)
|
Chris@16
|
63 );
|
Chris@16
|
64 }
|
Chris@16
|
65 };
|
Chris@16
|
66 }
|
Chris@16
|
67 namespace detail
|
Chris@16
|
68 {
|
Chris@16
|
69 template<typename Expr, typename Context>
|
Chris@16
|
70 struct is_expr_handled<Expr, Context, 2>
|
Chris@16
|
71 {
|
Chris@16
|
72 static callable_context_wrapper<Context> &sctx_;
|
Chris@16
|
73 static Expr &sexpr_;
|
Chris@16
|
74 static typename Expr::proto_tag &stag_;
|
Chris@16
|
75 static const bool value =
|
Chris@16
|
76 sizeof(yes_type) ==
|
Chris@16
|
77 sizeof(
|
Chris@16
|
78 detail::check_is_expr_handled(
|
Chris@16
|
79 (sctx_(
|
Chris@16
|
80 stag_
|
Chris@16
|
81 , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_)
|
Chris@16
|
82 ), 0)
|
Chris@16
|
83 )
|
Chris@16
|
84 );
|
Chris@16
|
85 typedef mpl::bool_<value> type;
|
Chris@16
|
86 };
|
Chris@16
|
87 }
|
Chris@16
|
88 namespace context
|
Chris@16
|
89 {
|
Chris@16
|
90
|
Chris@16
|
91
|
Chris@16
|
92
|
Chris@16
|
93
|
Chris@16
|
94
|
Chris@16
|
95
|
Chris@16
|
96
|
Chris@16
|
97
|
Chris@16
|
98
|
Chris@16
|
99
|
Chris@16
|
100
|
Chris@16
|
101
|
Chris@16
|
102 template<typename Expr, typename Context>
|
Chris@16
|
103 struct callable_eval<Expr, Context, 2>
|
Chris@16
|
104 {
|
Chris@16
|
105 typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1;
|
Chris@16
|
106 typedef
|
Chris@16
|
107 typename BOOST_PROTO_RESULT_OF<
|
Chris@16
|
108 Context(
|
Chris@16
|
109 typename Expr::proto_tag
|
Chris@16
|
110 , child0 , child1
|
Chris@16
|
111 )
|
Chris@16
|
112 >::type
|
Chris@16
|
113 result_type;
|
Chris@16
|
114
|
Chris@16
|
115
|
Chris@16
|
116
|
Chris@16
|
117 result_type operator ()(Expr &expr, Context &context) const
|
Chris@16
|
118 {
|
Chris@16
|
119 return context(
|
Chris@16
|
120 typename Expr::proto_tag()
|
Chris@16
|
121 , proto::child_c< 0>( expr) , proto::child_c< 1>( expr)
|
Chris@16
|
122 );
|
Chris@16
|
123 }
|
Chris@16
|
124 };
|
Chris@16
|
125 }
|
Chris@16
|
126 namespace detail
|
Chris@16
|
127 {
|
Chris@16
|
128 template<typename Expr, typename Context>
|
Chris@16
|
129 struct is_expr_handled<Expr, Context, 3>
|
Chris@16
|
130 {
|
Chris@16
|
131 static callable_context_wrapper<Context> &sctx_;
|
Chris@16
|
132 static Expr &sexpr_;
|
Chris@16
|
133 static typename Expr::proto_tag &stag_;
|
Chris@16
|
134 static const bool value =
|
Chris@16
|
135 sizeof(yes_type) ==
|
Chris@16
|
136 sizeof(
|
Chris@16
|
137 detail::check_is_expr_handled(
|
Chris@16
|
138 (sctx_(
|
Chris@16
|
139 stag_
|
Chris@16
|
140 , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_)
|
Chris@16
|
141 ), 0)
|
Chris@16
|
142 )
|
Chris@16
|
143 );
|
Chris@16
|
144 typedef mpl::bool_<value> type;
|
Chris@16
|
145 };
|
Chris@16
|
146 }
|
Chris@16
|
147 namespace context
|
Chris@16
|
148 {
|
Chris@16
|
149
|
Chris@16
|
150
|
Chris@16
|
151
|
Chris@16
|
152
|
Chris@16
|
153
|
Chris@16
|
154
|
Chris@16
|
155
|
Chris@16
|
156
|
Chris@16
|
157
|
Chris@16
|
158
|
Chris@16
|
159
|
Chris@16
|
160
|
Chris@16
|
161 template<typename Expr, typename Context>
|
Chris@16
|
162 struct callable_eval<Expr, Context, 3>
|
Chris@16
|
163 {
|
Chris@16
|
164 typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2;
|
Chris@16
|
165 typedef
|
Chris@16
|
166 typename BOOST_PROTO_RESULT_OF<
|
Chris@16
|
167 Context(
|
Chris@16
|
168 typename Expr::proto_tag
|
Chris@16
|
169 , child0 , child1 , child2
|
Chris@16
|
170 )
|
Chris@16
|
171 >::type
|
Chris@16
|
172 result_type;
|
Chris@16
|
173
|
Chris@16
|
174
|
Chris@16
|
175
|
Chris@16
|
176 result_type operator ()(Expr &expr, Context &context) const
|
Chris@16
|
177 {
|
Chris@16
|
178 return context(
|
Chris@16
|
179 typename Expr::proto_tag()
|
Chris@16
|
180 , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr)
|
Chris@16
|
181 );
|
Chris@16
|
182 }
|
Chris@16
|
183 };
|
Chris@16
|
184 }
|
Chris@16
|
185 namespace detail
|
Chris@16
|
186 {
|
Chris@16
|
187 template<typename Expr, typename Context>
|
Chris@16
|
188 struct is_expr_handled<Expr, Context, 4>
|
Chris@16
|
189 {
|
Chris@16
|
190 static callable_context_wrapper<Context> &sctx_;
|
Chris@16
|
191 static Expr &sexpr_;
|
Chris@16
|
192 static typename Expr::proto_tag &stag_;
|
Chris@16
|
193 static const bool value =
|
Chris@16
|
194 sizeof(yes_type) ==
|
Chris@16
|
195 sizeof(
|
Chris@16
|
196 detail::check_is_expr_handled(
|
Chris@16
|
197 (sctx_(
|
Chris@16
|
198 stag_
|
Chris@16
|
199 , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_)
|
Chris@16
|
200 ), 0)
|
Chris@16
|
201 )
|
Chris@16
|
202 );
|
Chris@16
|
203 typedef mpl::bool_<value> type;
|
Chris@16
|
204 };
|
Chris@16
|
205 }
|
Chris@16
|
206 namespace context
|
Chris@16
|
207 {
|
Chris@16
|
208
|
Chris@16
|
209
|
Chris@16
|
210
|
Chris@16
|
211
|
Chris@16
|
212
|
Chris@16
|
213
|
Chris@16
|
214
|
Chris@16
|
215
|
Chris@16
|
216
|
Chris@16
|
217
|
Chris@16
|
218
|
Chris@16
|
219
|
Chris@16
|
220 template<typename Expr, typename Context>
|
Chris@16
|
221 struct callable_eval<Expr, Context, 4>
|
Chris@16
|
222 {
|
Chris@16
|
223 typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3;
|
Chris@16
|
224 typedef
|
Chris@16
|
225 typename BOOST_PROTO_RESULT_OF<
|
Chris@16
|
226 Context(
|
Chris@16
|
227 typename Expr::proto_tag
|
Chris@16
|
228 , child0 , child1 , child2 , child3
|
Chris@16
|
229 )
|
Chris@16
|
230 >::type
|
Chris@16
|
231 result_type;
|
Chris@16
|
232
|
Chris@16
|
233
|
Chris@16
|
234
|
Chris@16
|
235 result_type operator ()(Expr &expr, Context &context) const
|
Chris@16
|
236 {
|
Chris@16
|
237 return context(
|
Chris@16
|
238 typename Expr::proto_tag()
|
Chris@16
|
239 , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr)
|
Chris@16
|
240 );
|
Chris@16
|
241 }
|
Chris@16
|
242 };
|
Chris@16
|
243 }
|
Chris@16
|
244 namespace detail
|
Chris@16
|
245 {
|
Chris@16
|
246 template<typename Expr, typename Context>
|
Chris@16
|
247 struct is_expr_handled<Expr, Context, 5>
|
Chris@16
|
248 {
|
Chris@16
|
249 static callable_context_wrapper<Context> &sctx_;
|
Chris@16
|
250 static Expr &sexpr_;
|
Chris@16
|
251 static typename Expr::proto_tag &stag_;
|
Chris@16
|
252 static const bool value =
|
Chris@16
|
253 sizeof(yes_type) ==
|
Chris@16
|
254 sizeof(
|
Chris@16
|
255 detail::check_is_expr_handled(
|
Chris@16
|
256 (sctx_(
|
Chris@16
|
257 stag_
|
Chris@16
|
258 , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_)
|
Chris@16
|
259 ), 0)
|
Chris@16
|
260 )
|
Chris@16
|
261 );
|
Chris@16
|
262 typedef mpl::bool_<value> type;
|
Chris@16
|
263 };
|
Chris@16
|
264 }
|
Chris@16
|
265 namespace context
|
Chris@16
|
266 {
|
Chris@16
|
267
|
Chris@16
|
268
|
Chris@16
|
269
|
Chris@16
|
270
|
Chris@16
|
271
|
Chris@16
|
272
|
Chris@16
|
273
|
Chris@16
|
274
|
Chris@16
|
275
|
Chris@16
|
276
|
Chris@16
|
277
|
Chris@16
|
278
|
Chris@16
|
279 template<typename Expr, typename Context>
|
Chris@16
|
280 struct callable_eval<Expr, Context, 5>
|
Chris@16
|
281 {
|
Chris@16
|
282 typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4;
|
Chris@16
|
283 typedef
|
Chris@16
|
284 typename BOOST_PROTO_RESULT_OF<
|
Chris@16
|
285 Context(
|
Chris@16
|
286 typename Expr::proto_tag
|
Chris@16
|
287 , child0 , child1 , child2 , child3 , child4
|
Chris@16
|
288 )
|
Chris@16
|
289 >::type
|
Chris@16
|
290 result_type;
|
Chris@16
|
291
|
Chris@16
|
292
|
Chris@16
|
293
|
Chris@16
|
294 result_type operator ()(Expr &expr, Context &context) const
|
Chris@16
|
295 {
|
Chris@16
|
296 return context(
|
Chris@16
|
297 typename Expr::proto_tag()
|
Chris@16
|
298 , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr)
|
Chris@16
|
299 );
|
Chris@16
|
300 }
|
Chris@16
|
301 };
|
Chris@16
|
302 }
|
Chris@16
|
303 namespace detail
|
Chris@16
|
304 {
|
Chris@16
|
305 template<typename Expr, typename Context>
|
Chris@16
|
306 struct is_expr_handled<Expr, Context, 6>
|
Chris@16
|
307 {
|
Chris@16
|
308 static callable_context_wrapper<Context> &sctx_;
|
Chris@16
|
309 static Expr &sexpr_;
|
Chris@16
|
310 static typename Expr::proto_tag &stag_;
|
Chris@16
|
311 static const bool value =
|
Chris@16
|
312 sizeof(yes_type) ==
|
Chris@16
|
313 sizeof(
|
Chris@16
|
314 detail::check_is_expr_handled(
|
Chris@16
|
315 (sctx_(
|
Chris@16
|
316 stag_
|
Chris@16
|
317 , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_)
|
Chris@16
|
318 ), 0)
|
Chris@16
|
319 )
|
Chris@16
|
320 );
|
Chris@16
|
321 typedef mpl::bool_<value> type;
|
Chris@16
|
322 };
|
Chris@16
|
323 }
|
Chris@16
|
324 namespace context
|
Chris@16
|
325 {
|
Chris@16
|
326
|
Chris@16
|
327
|
Chris@16
|
328
|
Chris@16
|
329
|
Chris@16
|
330
|
Chris@16
|
331
|
Chris@16
|
332
|
Chris@16
|
333
|
Chris@16
|
334
|
Chris@16
|
335
|
Chris@16
|
336
|
Chris@16
|
337
|
Chris@16
|
338 template<typename Expr, typename Context>
|
Chris@16
|
339 struct callable_eval<Expr, Context, 6>
|
Chris@16
|
340 {
|
Chris@16
|
341 typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5;
|
Chris@16
|
342 typedef
|
Chris@16
|
343 typename BOOST_PROTO_RESULT_OF<
|
Chris@16
|
344 Context(
|
Chris@16
|
345 typename Expr::proto_tag
|
Chris@16
|
346 , child0 , child1 , child2 , child3 , child4 , child5
|
Chris@16
|
347 )
|
Chris@16
|
348 >::type
|
Chris@16
|
349 result_type;
|
Chris@16
|
350
|
Chris@16
|
351
|
Chris@16
|
352
|
Chris@16
|
353 result_type operator ()(Expr &expr, Context &context) const
|
Chris@16
|
354 {
|
Chris@16
|
355 return context(
|
Chris@16
|
356 typename Expr::proto_tag()
|
Chris@16
|
357 , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr)
|
Chris@16
|
358 );
|
Chris@16
|
359 }
|
Chris@16
|
360 };
|
Chris@16
|
361 }
|
Chris@16
|
362 namespace detail
|
Chris@16
|
363 {
|
Chris@16
|
364 template<typename Expr, typename Context>
|
Chris@16
|
365 struct is_expr_handled<Expr, Context, 7>
|
Chris@16
|
366 {
|
Chris@16
|
367 static callable_context_wrapper<Context> &sctx_;
|
Chris@16
|
368 static Expr &sexpr_;
|
Chris@16
|
369 static typename Expr::proto_tag &stag_;
|
Chris@16
|
370 static const bool value =
|
Chris@16
|
371 sizeof(yes_type) ==
|
Chris@16
|
372 sizeof(
|
Chris@16
|
373 detail::check_is_expr_handled(
|
Chris@16
|
374 (sctx_(
|
Chris@16
|
375 stag_
|
Chris@16
|
376 , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_)
|
Chris@16
|
377 ), 0)
|
Chris@16
|
378 )
|
Chris@16
|
379 );
|
Chris@16
|
380 typedef mpl::bool_<value> type;
|
Chris@16
|
381 };
|
Chris@16
|
382 }
|
Chris@16
|
383 namespace context
|
Chris@16
|
384 {
|
Chris@16
|
385
|
Chris@16
|
386
|
Chris@16
|
387
|
Chris@16
|
388
|
Chris@16
|
389
|
Chris@16
|
390
|
Chris@16
|
391
|
Chris@16
|
392
|
Chris@16
|
393
|
Chris@16
|
394
|
Chris@16
|
395
|
Chris@16
|
396
|
Chris@16
|
397 template<typename Expr, typename Context>
|
Chris@16
|
398 struct callable_eval<Expr, Context, 7>
|
Chris@16
|
399 {
|
Chris@16
|
400 typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6;
|
Chris@16
|
401 typedef
|
Chris@16
|
402 typename BOOST_PROTO_RESULT_OF<
|
Chris@16
|
403 Context(
|
Chris@16
|
404 typename Expr::proto_tag
|
Chris@16
|
405 , child0 , child1 , child2 , child3 , child4 , child5 , child6
|
Chris@16
|
406 )
|
Chris@16
|
407 >::type
|
Chris@16
|
408 result_type;
|
Chris@16
|
409
|
Chris@16
|
410
|
Chris@16
|
411
|
Chris@16
|
412 result_type operator ()(Expr &expr, Context &context) const
|
Chris@16
|
413 {
|
Chris@16
|
414 return context(
|
Chris@16
|
415 typename Expr::proto_tag()
|
Chris@16
|
416 , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr)
|
Chris@16
|
417 );
|
Chris@16
|
418 }
|
Chris@16
|
419 };
|
Chris@16
|
420 }
|
Chris@16
|
421 namespace detail
|
Chris@16
|
422 {
|
Chris@16
|
423 template<typename Expr, typename Context>
|
Chris@16
|
424 struct is_expr_handled<Expr, Context, 8>
|
Chris@16
|
425 {
|
Chris@16
|
426 static callable_context_wrapper<Context> &sctx_;
|
Chris@16
|
427 static Expr &sexpr_;
|
Chris@16
|
428 static typename Expr::proto_tag &stag_;
|
Chris@16
|
429 static const bool value =
|
Chris@16
|
430 sizeof(yes_type) ==
|
Chris@16
|
431 sizeof(
|
Chris@16
|
432 detail::check_is_expr_handled(
|
Chris@16
|
433 (sctx_(
|
Chris@16
|
434 stag_
|
Chris@16
|
435 , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_) , proto::child_c< 7>( sexpr_)
|
Chris@16
|
436 ), 0)
|
Chris@16
|
437 )
|
Chris@16
|
438 );
|
Chris@16
|
439 typedef mpl::bool_<value> type;
|
Chris@16
|
440 };
|
Chris@16
|
441 }
|
Chris@16
|
442 namespace context
|
Chris@16
|
443 {
|
Chris@16
|
444
|
Chris@16
|
445
|
Chris@16
|
446
|
Chris@16
|
447
|
Chris@16
|
448
|
Chris@16
|
449
|
Chris@16
|
450
|
Chris@16
|
451
|
Chris@16
|
452
|
Chris@16
|
453
|
Chris@16
|
454
|
Chris@16
|
455
|
Chris@16
|
456 template<typename Expr, typename Context>
|
Chris@16
|
457 struct callable_eval<Expr, Context, 8>
|
Chris@16
|
458 {
|
Chris@16
|
459 typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6; typedef typename proto::result_of::child_c< Expr const &, 7>::type child7;
|
Chris@16
|
460 typedef
|
Chris@16
|
461 typename BOOST_PROTO_RESULT_OF<
|
Chris@16
|
462 Context(
|
Chris@16
|
463 typename Expr::proto_tag
|
Chris@16
|
464 , child0 , child1 , child2 , child3 , child4 , child5 , child6 , child7
|
Chris@16
|
465 )
|
Chris@16
|
466 >::type
|
Chris@16
|
467 result_type;
|
Chris@16
|
468
|
Chris@16
|
469
|
Chris@16
|
470
|
Chris@16
|
471 result_type operator ()(Expr &expr, Context &context) const
|
Chris@16
|
472 {
|
Chris@16
|
473 return context(
|
Chris@16
|
474 typename Expr::proto_tag()
|
Chris@16
|
475 , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr) , proto::child_c< 7>( expr)
|
Chris@16
|
476 );
|
Chris@16
|
477 }
|
Chris@16
|
478 };
|
Chris@16
|
479 }
|
Chris@16
|
480 namespace detail
|
Chris@16
|
481 {
|
Chris@16
|
482 template<typename Expr, typename Context>
|
Chris@16
|
483 struct is_expr_handled<Expr, Context, 9>
|
Chris@16
|
484 {
|
Chris@16
|
485 static callable_context_wrapper<Context> &sctx_;
|
Chris@16
|
486 static Expr &sexpr_;
|
Chris@16
|
487 static typename Expr::proto_tag &stag_;
|
Chris@16
|
488 static const bool value =
|
Chris@16
|
489 sizeof(yes_type) ==
|
Chris@16
|
490 sizeof(
|
Chris@16
|
491 detail::check_is_expr_handled(
|
Chris@16
|
492 (sctx_(
|
Chris@16
|
493 stag_
|
Chris@16
|
494 , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_) , proto::child_c< 7>( sexpr_) , proto::child_c< 8>( sexpr_)
|
Chris@16
|
495 ), 0)
|
Chris@16
|
496 )
|
Chris@16
|
497 );
|
Chris@16
|
498 typedef mpl::bool_<value> type;
|
Chris@16
|
499 };
|
Chris@16
|
500 }
|
Chris@16
|
501 namespace context
|
Chris@16
|
502 {
|
Chris@16
|
503
|
Chris@16
|
504
|
Chris@16
|
505
|
Chris@16
|
506
|
Chris@16
|
507
|
Chris@16
|
508
|
Chris@16
|
509
|
Chris@16
|
510
|
Chris@16
|
511
|
Chris@16
|
512
|
Chris@16
|
513
|
Chris@16
|
514
|
Chris@16
|
515 template<typename Expr, typename Context>
|
Chris@16
|
516 struct callable_eval<Expr, Context, 9>
|
Chris@16
|
517 {
|
Chris@16
|
518 typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6; typedef typename proto::result_of::child_c< Expr const &, 7>::type child7; typedef typename proto::result_of::child_c< Expr const &, 8>::type child8;
|
Chris@16
|
519 typedef
|
Chris@16
|
520 typename BOOST_PROTO_RESULT_OF<
|
Chris@16
|
521 Context(
|
Chris@16
|
522 typename Expr::proto_tag
|
Chris@16
|
523 , child0 , child1 , child2 , child3 , child4 , child5 , child6 , child7 , child8
|
Chris@16
|
524 )
|
Chris@16
|
525 >::type
|
Chris@16
|
526 result_type;
|
Chris@16
|
527
|
Chris@16
|
528
|
Chris@16
|
529
|
Chris@16
|
530 result_type operator ()(Expr &expr, Context &context) const
|
Chris@16
|
531 {
|
Chris@16
|
532 return context(
|
Chris@16
|
533 typename Expr::proto_tag()
|
Chris@16
|
534 , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr) , proto::child_c< 7>( expr) , proto::child_c< 8>( expr)
|
Chris@16
|
535 );
|
Chris@16
|
536 }
|
Chris@16
|
537 };
|
Chris@16
|
538 }
|
Chris@16
|
539 namespace detail
|
Chris@16
|
540 {
|
Chris@16
|
541 template<typename Expr, typename Context>
|
Chris@16
|
542 struct is_expr_handled<Expr, Context, 10>
|
Chris@16
|
543 {
|
Chris@16
|
544 static callable_context_wrapper<Context> &sctx_;
|
Chris@16
|
545 static Expr &sexpr_;
|
Chris@16
|
546 static typename Expr::proto_tag &stag_;
|
Chris@16
|
547 static const bool value =
|
Chris@16
|
548 sizeof(yes_type) ==
|
Chris@16
|
549 sizeof(
|
Chris@16
|
550 detail::check_is_expr_handled(
|
Chris@16
|
551 (sctx_(
|
Chris@16
|
552 stag_
|
Chris@16
|
553 , proto::child_c< 0>( sexpr_) , proto::child_c< 1>( sexpr_) , proto::child_c< 2>( sexpr_) , proto::child_c< 3>( sexpr_) , proto::child_c< 4>( sexpr_) , proto::child_c< 5>( sexpr_) , proto::child_c< 6>( sexpr_) , proto::child_c< 7>( sexpr_) , proto::child_c< 8>( sexpr_) , proto::child_c< 9>( sexpr_)
|
Chris@16
|
554 ), 0)
|
Chris@16
|
555 )
|
Chris@16
|
556 );
|
Chris@16
|
557 typedef mpl::bool_<value> type;
|
Chris@16
|
558 };
|
Chris@16
|
559 }
|
Chris@16
|
560 namespace context
|
Chris@16
|
561 {
|
Chris@16
|
562
|
Chris@16
|
563
|
Chris@16
|
564
|
Chris@16
|
565
|
Chris@16
|
566
|
Chris@16
|
567
|
Chris@16
|
568
|
Chris@16
|
569
|
Chris@16
|
570
|
Chris@16
|
571
|
Chris@16
|
572
|
Chris@16
|
573
|
Chris@16
|
574 template<typename Expr, typename Context>
|
Chris@16
|
575 struct callable_eval<Expr, Context, 10>
|
Chris@16
|
576 {
|
Chris@16
|
577 typedef typename proto::result_of::child_c< Expr const &, 0>::type child0; typedef typename proto::result_of::child_c< Expr const &, 1>::type child1; typedef typename proto::result_of::child_c< Expr const &, 2>::type child2; typedef typename proto::result_of::child_c< Expr const &, 3>::type child3; typedef typename proto::result_of::child_c< Expr const &, 4>::type child4; typedef typename proto::result_of::child_c< Expr const &, 5>::type child5; typedef typename proto::result_of::child_c< Expr const &, 6>::type child6; typedef typename proto::result_of::child_c< Expr const &, 7>::type child7; typedef typename proto::result_of::child_c< Expr const &, 8>::type child8; typedef typename proto::result_of::child_c< Expr const &, 9>::type child9;
|
Chris@16
|
578 typedef
|
Chris@16
|
579 typename BOOST_PROTO_RESULT_OF<
|
Chris@16
|
580 Context(
|
Chris@16
|
581 typename Expr::proto_tag
|
Chris@16
|
582 , child0 , child1 , child2 , child3 , child4 , child5 , child6 , child7 , child8 , child9
|
Chris@16
|
583 )
|
Chris@16
|
584 >::type
|
Chris@16
|
585 result_type;
|
Chris@16
|
586
|
Chris@16
|
587
|
Chris@16
|
588
|
Chris@16
|
589 result_type operator ()(Expr &expr, Context &context) const
|
Chris@16
|
590 {
|
Chris@16
|
591 return context(
|
Chris@16
|
592 typename Expr::proto_tag()
|
Chris@16
|
593 , proto::child_c< 0>( expr) , proto::child_c< 1>( expr) , proto::child_c< 2>( expr) , proto::child_c< 3>( expr) , proto::child_c< 4>( expr) , proto::child_c< 5>( expr) , proto::child_c< 6>( expr) , proto::child_c< 7>( expr) , proto::child_c< 8>( expr) , proto::child_c< 9>( expr)
|
Chris@16
|
594 );
|
Chris@16
|
595 }
|
Chris@16
|
596 };
|
Chris@16
|
597 }
|