blob: dcea342b2d8e0d8e30ade4401381f77376cb51d7 [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001
2// Copyright Aleksey Gurtovoy 2001-2004
3//
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)
7//
8
9// Preprocessed version of "ndnboost/mpl/aux_/full_lambda.hpp" header
10// -- DO NOT modify by hand!
11
12namespace ndnboost { namespace mpl {
13
14namespace aux {
15
16template<
17 bool C1 = false, bool C2 = false, bool C3 = false, bool C4 = false
18 , bool C5 = false
19 >
20struct lambda_or
21 : true_
22{
23};
24
25template<>
26struct lambda_or< false,false,false,false,false >
27 : false_
28{
29};
30
31} // namespace aux
32
33template<
34 typename T
35 , typename Tag
36 , typename Arity
37 >
38struct lambda
39{
40 typedef false_ is_le;
41 typedef T result_;
42 typedef T type;
43};
44
45template<
46 typename T
47 >
48struct is_lambda_expression
49 : lambda<T>::is_le
50{
51};
52
53template< int N, typename Tag >
54struct lambda< arg<N>,Tag, int_< -1 > >
55{
56 typedef true_ is_le;
57 typedef mpl::arg<N> result_; // qualified for the sake of MIPSpro 7.41
58 typedef mpl::protect<result_> type;
59};
60
61template<
62 typename F
63 , typename Tag
64 >
65struct lambda<
66 bind0<F>
67 , Tag
68 , int_<1>
69 >
70{
71 typedef false_ is_le;
72 typedef bind0<
73 F
74 > result_;
75
76 typedef result_ type;
77};
78
79namespace aux {
80
81template<
82 typename IsLE, typename Tag
83 , template< typename P1 > class F
84 , typename L1
85 >
86struct le_result1
87{
88 typedef F<
89 typename L1::type
90 > result_;
91
92 typedef result_ type;
93};
94
95template<
96 typename Tag
97 , template< typename P1 > class F
98 , typename L1
99 >
100struct le_result1< true_,Tag,F,L1 >
101{
102 typedef bind1<
103 quote1< F,Tag >
104 , typename L1::result_
105 > result_;
106
107 typedef mpl::protect<result_> type;
108};
109
110} // namespace aux
111
112template<
113 template< typename P1 > class F
114 , typename T1
115 , typename Tag
116 >
117struct lambda<
118 F<T1>
119 , Tag
120 , int_<1>
121 >
122{
123 typedef lambda< T1,Tag > l1;
124 typedef typename l1::is_le is_le1;
125 typedef typename aux::lambda_or<
126 is_le1::value
127 >::type is_le;
128
129 typedef aux::le_result1<
130 is_le, Tag, F, l1
131 > le_result_;
132
133 typedef typename le_result_::result_ result_;
134 typedef typename le_result_::type type;
135};
136
137template<
138 typename F, typename T1
139 , typename Tag
140 >
141struct lambda<
142 bind1< F,T1 >
143 , Tag
144 , int_<2>
145 >
146{
147 typedef false_ is_le;
148 typedef bind1<
149 F
150 , T1
151 > result_;
152
153 typedef result_ type;
154};
155
156namespace aux {
157
158template<
159 typename IsLE, typename Tag
160 , template< typename P1, typename P2 > class F
161 , typename L1, typename L2
162 >
163struct le_result2
164{
165 typedef F<
166 typename L1::type, typename L2::type
167 > result_;
168
169 typedef result_ type;
170};
171
172template<
173 typename Tag
174 , template< typename P1, typename P2 > class F
175 , typename L1, typename L2
176 >
177struct le_result2< true_,Tag,F,L1,L2 >
178{
179 typedef bind2<
180 quote2< F,Tag >
181 , typename L1::result_, typename L2::result_
182 > result_;
183
184 typedef mpl::protect<result_> type;
185};
186
187} // namespace aux
188
189template<
190 template< typename P1, typename P2 > class F
191 , typename T1, typename T2
192 , typename Tag
193 >
194struct lambda<
195 F< T1,T2 >
196 , Tag
197 , int_<2>
198 >
199{
200 typedef lambda< T1,Tag > l1;
201 typedef lambda< T2,Tag > l2;
202
203 typedef typename l1::is_le is_le1;
204 typedef typename l2::is_le is_le2;
205
206
207 typedef typename aux::lambda_or<
208 is_le1::value, is_le2::value
209 >::type is_le;
210
211 typedef aux::le_result2<
212 is_le, Tag, F, l1, l2
213 > le_result_;
214
215 typedef typename le_result_::result_ result_;
216 typedef typename le_result_::type type;
217};
218
219template<
220 typename F, typename T1, typename T2
221 , typename Tag
222 >
223struct lambda<
224 bind2< F,T1,T2 >
225 , Tag
226 , int_<3>
227 >
228{
229 typedef false_ is_le;
230 typedef bind2<
231 F
232 , T1, T2
233 > result_;
234
235 typedef result_ type;
236};
237
238namespace aux {
239
240template<
241 typename IsLE, typename Tag
242 , template< typename P1, typename P2, typename P3 > class F
243 , typename L1, typename L2, typename L3
244 >
245struct le_result3
246{
247 typedef F<
248 typename L1::type, typename L2::type, typename L3::type
249 > result_;
250
251 typedef result_ type;
252};
253
254template<
255 typename Tag
256 , template< typename P1, typename P2, typename P3 > class F
257 , typename L1, typename L2, typename L3
258 >
259struct le_result3< true_,Tag,F,L1,L2,L3 >
260{
261 typedef bind3<
262 quote3< F,Tag >
263 , typename L1::result_, typename L2::result_, typename L3::result_
264 > result_;
265
266 typedef mpl::protect<result_> type;
267};
268
269} // namespace aux
270
271template<
272 template< typename P1, typename P2, typename P3 > class F
273 , typename T1, typename T2, typename T3
274 , typename Tag
275 >
276struct lambda<
277 F< T1,T2,T3 >
278 , Tag
279 , int_<3>
280 >
281{
282 typedef lambda< T1,Tag > l1;
283 typedef lambda< T2,Tag > l2;
284 typedef lambda< T3,Tag > l3;
285
286 typedef typename l1::is_le is_le1;
287 typedef typename l2::is_le is_le2;
288 typedef typename l3::is_le is_le3;
289
290
291 typedef typename aux::lambda_or<
292 is_le1::value, is_le2::value, is_le3::value
293 >::type is_le;
294
295 typedef aux::le_result3<
296 is_le, Tag, F, l1, l2, l3
297 > le_result_;
298
299 typedef typename le_result_::result_ result_;
300 typedef typename le_result_::type type;
301};
302
303template<
304 typename F, typename T1, typename T2, typename T3
305 , typename Tag
306 >
307struct lambda<
308 bind3< F,T1,T2,T3 >
309 , Tag
310 , int_<4>
311 >
312{
313 typedef false_ is_le;
314 typedef bind3<
315 F
316 , T1, T2, T3
317 > result_;
318
319 typedef result_ type;
320};
321
322namespace aux {
323
324template<
325 typename IsLE, typename Tag
326 , template< typename P1, typename P2, typename P3, typename P4 > class F
327 , typename L1, typename L2, typename L3, typename L4
328 >
329struct le_result4
330{
331 typedef F<
332 typename L1::type, typename L2::type, typename L3::type
333 , typename L4::type
334 > result_;
335
336 typedef result_ type;
337};
338
339template<
340 typename Tag
341 , template< typename P1, typename P2, typename P3, typename P4 > class F
342 , typename L1, typename L2, typename L3, typename L4
343 >
344struct le_result4< true_,Tag,F,L1,L2,L3,L4 >
345{
346 typedef bind4<
347 quote4< F,Tag >
348 , typename L1::result_, typename L2::result_, typename L3::result_
349 , typename L4::result_
350 > result_;
351
352 typedef mpl::protect<result_> type;
353};
354
355} // namespace aux
356
357template<
358 template< typename P1, typename P2, typename P3, typename P4 > class F
359 , typename T1, typename T2, typename T3, typename T4
360 , typename Tag
361 >
362struct lambda<
363 F< T1,T2,T3,T4 >
364 , Tag
365 , int_<4>
366 >
367{
368 typedef lambda< T1,Tag > l1;
369 typedef lambda< T2,Tag > l2;
370 typedef lambda< T3,Tag > l3;
371 typedef lambda< T4,Tag > l4;
372
373 typedef typename l1::is_le is_le1;
374 typedef typename l2::is_le is_le2;
375 typedef typename l3::is_le is_le3;
376 typedef typename l4::is_le is_le4;
377
378
379 typedef typename aux::lambda_or<
380 is_le1::value, is_le2::value, is_le3::value, is_le4::value
381 >::type is_le;
382
383 typedef aux::le_result4<
384 is_le, Tag, F, l1, l2, l3, l4
385 > le_result_;
386
387 typedef typename le_result_::result_ result_;
388 typedef typename le_result_::type type;
389};
390
391template<
392 typename F, typename T1, typename T2, typename T3, typename T4
393 , typename Tag
394 >
395struct lambda<
396 bind4< F,T1,T2,T3,T4 >
397 , Tag
398 , int_<5>
399 >
400{
401 typedef false_ is_le;
402 typedef bind4<
403 F
404 , T1, T2, T3, T4
405 > result_;
406
407 typedef result_ type;
408};
409
410namespace aux {
411
412template<
413 typename IsLE, typename Tag
414 , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F
415 , typename L1, typename L2, typename L3, typename L4, typename L5
416 >
417struct le_result5
418{
419 typedef F<
420 typename L1::type, typename L2::type, typename L3::type
421 , typename L4::type, typename L5::type
422 > result_;
423
424 typedef result_ type;
425};
426
427template<
428 typename Tag
429 , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F
430 , typename L1, typename L2, typename L3, typename L4, typename L5
431 >
432struct le_result5< true_,Tag,F,L1,L2,L3,L4,L5 >
433{
434 typedef bind5<
435 quote5< F,Tag >
436 , typename L1::result_, typename L2::result_, typename L3::result_
437 , typename L4::result_, typename L5::result_
438 > result_;
439
440 typedef mpl::protect<result_> type;
441};
442
443} // namespace aux
444
445template<
446 template<
447 typename P1, typename P2, typename P3, typename P4
448 , typename P5
449 >
450 class F
451 , typename T1, typename T2, typename T3, typename T4, typename T5
452 , typename Tag
453 >
454struct lambda<
455 F< T1,T2,T3,T4,T5 >
456 , Tag
457 , int_<5>
458 >
459{
460 typedef lambda< T1,Tag > l1;
461 typedef lambda< T2,Tag > l2;
462 typedef lambda< T3,Tag > l3;
463 typedef lambda< T4,Tag > l4;
464 typedef lambda< T5,Tag > l5;
465
466 typedef typename l1::is_le is_le1;
467 typedef typename l2::is_le is_le2;
468 typedef typename l3::is_le is_le3;
469 typedef typename l4::is_le is_le4;
470 typedef typename l5::is_le is_le5;
471
472
473 typedef typename aux::lambda_or<
474 is_le1::value, is_le2::value, is_le3::value, is_le4::value
475 , is_le5::value
476 >::type is_le;
477
478 typedef aux::le_result5<
479 is_le, Tag, F, l1, l2, l3, l4, l5
480 > le_result_;
481
482 typedef typename le_result_::result_ result_;
483 typedef typename le_result_::type type;
484};
485
486template<
487 typename F, typename T1, typename T2, typename T3, typename T4
488 , typename T5
489 , typename Tag
490 >
491struct lambda<
492 bind5< F,T1,T2,T3,T4,T5 >
493 , Tag
494 , int_<6>
495 >
496{
497 typedef false_ is_le;
498 typedef bind5<
499 F
500 , T1, T2, T3, T4, T5
501 > result_;
502
503 typedef result_ type;
504};
505
506/// special case for 'protect'
507template< typename T, typename Tag >
508struct lambda< mpl::protect<T>,Tag, int_<1> >
509{
510 typedef false_ is_le;
511 typedef mpl::protect<T> result_;
512 typedef result_ type;
513};
514
515/// specializations for the main 'bind' form
516
517template<
518 typename F, typename T1, typename T2, typename T3, typename T4
519 , typename T5
520 , typename Tag
521 >
522struct lambda<
523 bind< F,T1,T2,T3,T4,T5 >
524 , Tag
525 , int_<6>
526 >
527{
528 typedef false_ is_le;
529 typedef bind< F,T1,T2,T3,T4,T5 > result_;
530 typedef result_ type;
531};
532
533template<
534 typename F
535 , typename Tag1
536 , typename Tag2
537 , typename Arity
538 >
539struct lambda<
540 lambda< F,Tag1,Arity >
541 , Tag2
542 , int_<3>
543 >
544{
545 typedef lambda< F,Tag2 > l1;
546 typedef lambda< Tag1,Tag2 > l2;
547 typedef typename l1::is_le is_le;
548 typedef bind1< quote1<aux::template_arity>, typename l1::result_ > arity_;
549 typedef lambda< typename if_< is_le,arity_,Arity >::type, Tag2 > l3;
550 typedef aux::le_result3<is_le, Tag2, mpl::lambda, l1, l2, l3> le_result_;
551 typedef typename le_result_::result_ result_;
552 typedef typename le_result_::type type;
553};
554
555BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)
556
557}}
558