Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/spirit/home/classic/phoenix/new.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 /*============================================================================= | |
2 Phoenix V1.2.1 | |
3 Copyright (c) 2001-2003 Joel de Guzman | |
4 Copyright (c) 2001-2003 Hartmut Kaiser | |
5 Copyright (c) 2003 Vaclav Vesely | |
6 | |
7 Distributed under the Boost Software License, Version 1.0. (See accompanying | |
8 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
9 ==============================================================================*/ | |
10 | |
11 #ifndef PHOENIX_NEW_HPP | |
12 #define PHOENIX_NEW_HPP | |
13 | |
14 /////////////////////////////////////////////////////////////////////////////// | |
15 #include <boost/spirit/home/classic/phoenix/actor.hpp> | |
16 #include <boost/spirit/home/classic/phoenix/composite.hpp> | |
17 #include <boost/static_assert.hpp> | |
18 | |
19 /////////////////////////////////////////////////////////////////////////////// | |
20 namespace phoenix { | |
21 | |
22 /////////////////////////////////////////////////////////////////////////////// | |
23 // | |
24 // Phoenix predefined maximum new_ limit. This limit defines the maximum | |
25 // number of parameters supported for calles to the set of new_ template | |
26 // functions (lazy object construction, see below). This number defaults to 3. | |
27 // The actual maximum is rounded up in multiples of 3. Thus, if this value | |
28 // is 4, the actual limit is 6. The ultimate maximum limit in this | |
29 // implementation is 15. | |
30 // PHOENIX_CONSTRUCT_LIMIT should NOT be greater than PHOENIX_LIMIT! | |
31 | |
32 #if !defined(PHOENIX_CONSTRUCT_LIMIT) | |
33 #define PHOENIX_CONSTRUCT_LIMIT PHOENIX_LIMIT | |
34 #endif | |
35 | |
36 // ensure PHOENIX_CONSTRUCT_LIMIT <= PHOENIX_LIMIT | |
37 BOOST_STATIC_ASSERT(PHOENIX_CONSTRUCT_LIMIT <= PHOENIX_LIMIT); | |
38 | |
39 // ensure PHOENIX_CONSTRUCT_LIMIT <= 15 | |
40 BOOST_STATIC_ASSERT(PHOENIX_CONSTRUCT_LIMIT <= 15); | |
41 | |
42 /////////////////////////////////////////////////////////////////////////////// | |
43 // | |
44 // new_ | |
45 // | |
46 // Lazy object construction | |
47 // | |
48 // The set of new_<> template classes and functions provide a way | |
49 // of lazily constructing certain object from a arbitrary set of | |
50 // actors during parsing. | |
51 // The new_ templates are (syntactically) used very much like | |
52 // the well known C++ casts: | |
53 // | |
54 // A *a = new_<A>(...arbitrary list of actors...); | |
55 // | |
56 // where the given parameters are submitted as parameters to the | |
57 // contructor of the object of type A. (This certainly implies, that | |
58 // type A has a constructor with a fitting set of parameter types | |
59 // defined.) | |
60 // | |
61 // The maximum number of needed parameters is controlled through the | |
62 // preprocessor constant PHOENIX_CONSTRUCT_LIMIT. Note though, that this | |
63 // limit should not be greater than PHOENIX_LIMIT. | |
64 // | |
65 /////////////////////////////////////////////////////////////////////////////// | |
66 | |
67 template <typename T> | |
68 struct new_l_0 | |
69 { | |
70 typedef T* result_type; | |
71 | |
72 T* operator()() const | |
73 { | |
74 return new T(); | |
75 } | |
76 }; | |
77 | |
78 template <typename T> | |
79 struct new_l { | |
80 | |
81 template < | |
82 typename A | |
83 , typename B | |
84 , typename C | |
85 | |
86 #if PHOENIX_CONSTRUCT_LIMIT > 3 | |
87 , typename D | |
88 , typename E | |
89 , typename F | |
90 | |
91 #if PHOENIX_CONSTRUCT_LIMIT > 6 | |
92 , typename G | |
93 , typename H | |
94 , typename I | |
95 | |
96 #if PHOENIX_CONSTRUCT_LIMIT > 9 | |
97 , typename J | |
98 , typename K | |
99 , typename L | |
100 | |
101 #if PHOENIX_CONSTRUCT_LIMIT > 12 | |
102 , typename M | |
103 , typename N | |
104 , typename O | |
105 #endif | |
106 #endif | |
107 #endif | |
108 #endif | |
109 > | |
110 struct result { typedef T* type; }; | |
111 | |
112 T* operator()() const { | |
113 return new T(); | |
114 } | |
115 | |
116 template <typename A> | |
117 T* operator()(A const& a) const { | |
118 return new T(a); | |
119 } | |
120 | |
121 template <typename A, typename B> | |
122 T* operator()(A const& a, B const& b) const { | |
123 return new T(a, b); | |
124 } | |
125 | |
126 template <typename A, typename B, typename C> | |
127 T* operator()(A const& a, B const& b, C const& c) const { | |
128 return new T(a, b, c); | |
129 } | |
130 | |
131 #if PHOENIX_CONSTRUCT_LIMIT > 3 | |
132 template < | |
133 typename A, typename B, typename C, typename D | |
134 > | |
135 T* operator()( | |
136 A const& a, B const& b, C const& c, D const& d) const | |
137 { | |
138 return new T(a, b, c, d); | |
139 } | |
140 | |
141 template < | |
142 typename A, typename B, typename C, typename D, typename E | |
143 > | |
144 T* operator()( | |
145 A const& a, B const& b, C const& c, D const& d, E const& e) const | |
146 { | |
147 return new T(a, b, c, d, e); | |
148 } | |
149 | |
150 template < | |
151 typename A, typename B, typename C, typename D, typename E, | |
152 typename F | |
153 > | |
154 T* operator()( | |
155 A const& a, B const& b, C const& c, D const& d, E const& e, | |
156 F const& f) const | |
157 { | |
158 return new T(a, b, c, d, e, f); | |
159 } | |
160 | |
161 #if PHOENIX_CONSTRUCT_LIMIT > 6 | |
162 template < | |
163 typename A, typename B, typename C, typename D, typename E, | |
164 typename F, typename G | |
165 > | |
166 T* operator()( | |
167 A const& a, B const& b, C const& c, D const& d, E const& e, | |
168 F const& f, G const& g) const | |
169 { | |
170 return new T(a, b, c, d, e, f, g); | |
171 } | |
172 | |
173 template < | |
174 typename A, typename B, typename C, typename D, typename E, | |
175 typename F, typename G, typename H | |
176 > | |
177 T* operator()( | |
178 A const& a, B const& b, C const& c, D const& d, E const& e, | |
179 F const& f, G const& g, H const& h) const | |
180 { | |
181 return new T(a, b, c, d, e, f, g, h); | |
182 } | |
183 | |
184 template < | |
185 typename A, typename B, typename C, typename D, typename E, | |
186 typename F, typename G, typename H, typename I | |
187 > | |
188 T* operator()( | |
189 A const& a, B const& b, C const& c, D const& d, E const& e, | |
190 F const& f, G const& g, H const& h, I const& i) const | |
191 { | |
192 return new T(a, b, c, d, e, f, g, h, i); | |
193 } | |
194 | |
195 #if PHOENIX_CONSTRUCT_LIMIT > 9 | |
196 template < | |
197 typename A, typename B, typename C, typename D, typename E, | |
198 typename F, typename G, typename H, typename I, typename J | |
199 > | |
200 T* operator()( | |
201 A const& a, B const& b, C const& c, D const& d, E const& e, | |
202 F const& f, G const& g, H const& h, I const& i, J const& j) const | |
203 { | |
204 return new T(a, b, c, d, e, f, g, h, i, j); | |
205 } | |
206 | |
207 template < | |
208 typename A, typename B, typename C, typename D, typename E, | |
209 typename F, typename G, typename H, typename I, typename J, | |
210 typename K | |
211 > | |
212 T* operator()( | |
213 A const& a, B const& b, C const& c, D const& d, E const& e, | |
214 F const& f, G const& g, H const& h, I const& i, J const& j, | |
215 K const& k) const | |
216 { | |
217 return new T(a, b, c, d, e, f, g, h, i, j, k); | |
218 } | |
219 | |
220 template < | |
221 typename A, typename B, typename C, typename D, typename E, | |
222 typename F, typename G, typename H, typename I, typename J, | |
223 typename K, typename L | |
224 > | |
225 T* operator()( | |
226 A const& a, B const& b, C const& c, D const& d, E const& e, | |
227 F const& f, G const& g, H const& h, I const& i, J const& j, | |
228 K const& k, L const& l) const | |
229 { | |
230 return new T(a, b, c, d, e, f, g, h, i, j, k, l); | |
231 } | |
232 | |
233 #if PHOENIX_CONSTRUCT_LIMIT > 12 | |
234 template < | |
235 typename A, typename B, typename C, typename D, typename E, | |
236 typename F, typename G, typename H, typename I, typename J, | |
237 typename K, typename L, typename M | |
238 > | |
239 T* operator()( | |
240 A const& a, B const& b, C const& c, D const& d, E const& e, | |
241 F const& f, G const& g, H const& h, I const& i, J const& j, | |
242 K const& k, L const& l, M const& m) const | |
243 { | |
244 return new T(a, b, c, d, e, f, g, h, i, j, k, l, m); | |
245 } | |
246 | |
247 template < | |
248 typename A, typename B, typename C, typename D, typename E, | |
249 typename F, typename G, typename H, typename I, typename J, | |
250 typename K, typename L, typename M, typename N | |
251 > | |
252 T* operator()( | |
253 A const& a, B const& b, C const& c, D const& d, E const& e, | |
254 F const& f, G const& g, H const& h, I const& i, J const& j, | |
255 K const& k, L const& l, M const& m, N const& n) const | |
256 { | |
257 return new T(a, b, c, d, e, f, g, h, i, j, k, l, m, n); | |
258 } | |
259 | |
260 template < | |
261 typename A, typename B, typename C, typename D, typename E, | |
262 typename F, typename G, typename H, typename I, typename J, | |
263 typename K, typename L, typename M, typename N, typename O | |
264 > | |
265 T* operator()( | |
266 A const& a, B const& b, C const& c, D const& d, E const& e, | |
267 F const& f, G const& g, H const& h, I const& i, J const& j, | |
268 K const& k, L const& l, M const& m, N const& n, O const& o) const | |
269 { | |
270 return new T(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); | |
271 } | |
272 | |
273 #endif | |
274 #endif | |
275 #endif | |
276 #endif | |
277 }; | |
278 | |
279 template <typename T> | |
280 struct new_1 { | |
281 | |
282 template < | |
283 typename A | |
284 > | |
285 struct result { typedef T* type; }; | |
286 | |
287 template <typename A> | |
288 T* operator()(A const& a) const { | |
289 return new T(a); | |
290 } | |
291 | |
292 }; | |
293 | |
294 template <typename T> | |
295 struct new_2 { | |
296 | |
297 template < | |
298 typename A | |
299 , typename B | |
300 > | |
301 struct result { typedef T* type; }; | |
302 | |
303 template <typename A, typename B> | |
304 T* operator()(A const& a, B const& b) const { | |
305 return new T(a, b); | |
306 } | |
307 | |
308 }; | |
309 | |
310 template <typename T> | |
311 struct new_3 { | |
312 | |
313 template < | |
314 typename A | |
315 , typename B | |
316 , typename C | |
317 > | |
318 struct result { typedef T* type; }; | |
319 | |
320 template <typename A, typename B, typename C> | |
321 T* operator()(A const& a, B const& b, C const& c) const { | |
322 return new T(a, b, c); | |
323 } | |
324 }; | |
325 | |
326 #if PHOENIX_CONSTRUCT_LIMIT > 3 | |
327 template <typename T> | |
328 struct new_4 { | |
329 | |
330 template < | |
331 typename A | |
332 , typename B | |
333 , typename C | |
334 , typename D | |
335 > | |
336 struct result { typedef T* type; }; | |
337 | |
338 | |
339 template < | |
340 typename A, typename B, typename C, typename D | |
341 > | |
342 T* operator()( | |
343 A const& a, B const& b, C const& c, D const& d) const | |
344 { | |
345 return new T(a, b, c, d); | |
346 } | |
347 }; | |
348 | |
349 | |
350 template <typename T> | |
351 struct new_5 { | |
352 | |
353 template < | |
354 typename A | |
355 , typename B | |
356 , typename C | |
357 , typename D | |
358 , typename E | |
359 > | |
360 struct result { typedef T* type; }; | |
361 | |
362 template < | |
363 typename A, typename B, typename C, typename D, typename E | |
364 > | |
365 T* operator()( | |
366 A const& a, B const& b, C const& c, D const& d, E const& e) const | |
367 { | |
368 return new T(a, b, c, d, e); | |
369 } | |
370 }; | |
371 | |
372 | |
373 template <typename T> | |
374 struct new_6 { | |
375 | |
376 template < | |
377 typename A | |
378 , typename B | |
379 , typename C | |
380 , typename D | |
381 , typename E | |
382 , typename F | |
383 > | |
384 struct result { typedef T* type; }; | |
385 | |
386 template < | |
387 typename A, typename B, typename C, typename D, typename E, | |
388 typename F | |
389 > | |
390 T* operator()( | |
391 A const& a, B const& b, C const& c, D const& d, E const& e, | |
392 F const& f) const | |
393 { | |
394 return new T(a, b, c, d, e, f); | |
395 } | |
396 }; | |
397 #endif | |
398 | |
399 | |
400 #if PHOENIX_CONSTRUCT_LIMIT > 6 | |
401 template <typename T> | |
402 struct new_7 { | |
403 | |
404 template < | |
405 typename A | |
406 , typename B | |
407 , typename C | |
408 , typename D | |
409 , typename E | |
410 , typename F | |
411 , typename G | |
412 > | |
413 struct result { typedef T* type; }; | |
414 | |
415 template < | |
416 typename A, typename B, typename C, typename D, typename E, | |
417 typename F, typename G | |
418 > | |
419 T* operator()( | |
420 A const& a, B const& b, C const& c, D const& d, E const& e, | |
421 F const& f, G const& g) const | |
422 { | |
423 return new T(a, b, c, d, e, f, g); | |
424 } | |
425 }; | |
426 | |
427 template <typename T> | |
428 struct new_8 { | |
429 | |
430 template < | |
431 typename A | |
432 , typename B | |
433 , typename C | |
434 , typename D | |
435 , typename E | |
436 , typename F | |
437 , typename G | |
438 , typename H | |
439 > | |
440 struct result { typedef T* type; }; | |
441 | |
442 template < | |
443 typename A, typename B, typename C, typename D, typename E, | |
444 typename F, typename G, typename H | |
445 > | |
446 T* operator()( | |
447 A const& a, B const& b, C const& c, D const& d, E const& e, | |
448 F const& f, G const& g, H const& h) const | |
449 { | |
450 return new T(a, b, c, d, e, f, g, h); | |
451 } | |
452 }; | |
453 | |
454 template <typename T> | |
455 struct new_9 { | |
456 | |
457 template < | |
458 typename A | |
459 , typename B | |
460 , typename C | |
461 , typename D | |
462 , typename E | |
463 , typename F | |
464 , typename G | |
465 , typename H | |
466 , typename I | |
467 > | |
468 struct result { typedef T* type; }; | |
469 | |
470 template < | |
471 typename A, typename B, typename C, typename D, typename E, | |
472 typename F, typename G, typename H, typename I | |
473 > | |
474 T* operator()( | |
475 A const& a, B const& b, C const& c, D const& d, E const& e, | |
476 F const& f, G const& g, H const& h, I const& i) const | |
477 { | |
478 return new T(a, b, c, d, e, f, g, h, i); | |
479 } | |
480 }; | |
481 #endif | |
482 | |
483 | |
484 #if PHOENIX_CONSTRUCT_LIMIT > 9 | |
485 template <typename T> | |
486 struct new_10 { | |
487 | |
488 template < | |
489 typename A | |
490 , typename B | |
491 , typename C | |
492 , typename D | |
493 , typename E | |
494 , typename F | |
495 , typename G | |
496 , typename H | |
497 , typename I | |
498 , typename J | |
499 > | |
500 struct result { typedef T* type; }; | |
501 | |
502 | |
503 template < | |
504 typename A, typename B, typename C, typename D, typename E, | |
505 typename F, typename G, typename H, typename I, typename J | |
506 > | |
507 T* operator()( | |
508 A const& a, B const& b, C const& c, D const& d, E const& e, | |
509 F const& f, G const& g, H const& h, I const& i, J const& j) const | |
510 { | |
511 return new T(a, b, c, d, e, f, g, h, i, j); | |
512 } | |
513 }; | |
514 | |
515 template <typename T> | |
516 struct new_11 { | |
517 | |
518 template < | |
519 typename A | |
520 , typename B | |
521 , typename C | |
522 , typename D | |
523 , typename E | |
524 , typename F | |
525 , typename G | |
526 , typename H | |
527 , typename I | |
528 , typename J | |
529 , typename K | |
530 > | |
531 struct result { typedef T* type; }; | |
532 | |
533 | |
534 template < | |
535 typename A, typename B, typename C, typename D, typename E, | |
536 typename F, typename G, typename H, typename I, typename J, | |
537 typename K | |
538 > | |
539 T* operator()( | |
540 A const& a, B const& b, C const& c, D const& d, E const& e, | |
541 F const& f, G const& g, H const& h, I const& i, J const& j, | |
542 K const& k) const | |
543 { | |
544 return new T(a, b, c, d, e, f, g, h, i, j, k); | |
545 } | |
546 | |
547 }; | |
548 | |
549 template <typename T> | |
550 struct new_12 { | |
551 | |
552 template < | |
553 typename A | |
554 , typename B | |
555 , typename C | |
556 , typename D | |
557 , typename E | |
558 , typename F | |
559 , typename G | |
560 , typename H | |
561 , typename I | |
562 , typename J | |
563 , typename K | |
564 , typename L | |
565 > | |
566 struct result { typedef T* type; }; | |
567 | |
568 | |
569 template < | |
570 typename A, typename B, typename C, typename D, typename E, | |
571 typename F, typename G, typename H, typename I, typename J, | |
572 typename K, typename L | |
573 > | |
574 T* operator()( | |
575 A const& a, B const& b, C const& c, D const& d, E const& e, | |
576 F const& f, G const& g, H const& h, I const& i, J const& j, | |
577 K const& k, L const& l) const | |
578 { | |
579 return new T(a, b, c, d, f, e, g, h, i, j, k, l); | |
580 } | |
581 }; | |
582 #endif | |
583 | |
584 #if PHOENIX_CONSTRUCT_LIMIT > 12 | |
585 template <typename T> | |
586 struct new_13 { | |
587 | |
588 template < | |
589 typename A | |
590 , typename B | |
591 , typename C | |
592 , typename D | |
593 , typename E | |
594 , typename F | |
595 , typename G | |
596 , typename H | |
597 , typename I | |
598 , typename J | |
599 , typename K | |
600 , typename L | |
601 , typename M | |
602 > | |
603 struct result { typedef T* type; }; | |
604 | |
605 | |
606 template < | |
607 typename A, typename B, typename C, typename D, typename E, | |
608 typename F, typename G, typename H, typename I, typename J, | |
609 typename K, typename L, typename M | |
610 > | |
611 T* operator()( | |
612 A const& a, B const& b, C const& c, D const& d, E const& e, | |
613 F const& f, G const& g, H const& h, I const& i, J const& j, | |
614 K const& k, L const& l, M const& m) const | |
615 { | |
616 return new T(a, b, c, d, e, f, g, h, i, j, k, l, m); | |
617 } | |
618 }; | |
619 | |
620 template <typename T> | |
621 struct new_14 { | |
622 | |
623 template < | |
624 typename A | |
625 , typename B | |
626 , typename C | |
627 , typename D | |
628 , typename E | |
629 , typename F | |
630 , typename G | |
631 , typename H | |
632 , typename I | |
633 , typename J | |
634 , typename K | |
635 , typename L | |
636 , typename M | |
637 , typename N | |
638 > | |
639 struct result { typedef T* type; }; | |
640 | |
641 | |
642 template < | |
643 typename A, typename B, typename C, typename D, typename E, | |
644 typename F, typename G, typename H, typename I, typename J, | |
645 typename K, typename L, typename M, typename N | |
646 > | |
647 T* operator()( | |
648 A const& a, B const& b, C const& c, D const& d, E const& e, | |
649 F const& f, G const& g, H const& h, I const& i, J const& j, | |
650 K const& k, L const& l, M const& m, N const& n) const | |
651 { | |
652 return new T(a, b, c, d, e, f, g, h, i, j, k, l, m, n); | |
653 } | |
654 | |
655 }; | |
656 | |
657 template <typename T> | |
658 struct new_15 { | |
659 | |
660 template < | |
661 typename A | |
662 , typename B | |
663 , typename C | |
664 , typename D | |
665 , typename E | |
666 , typename F | |
667 , typename G | |
668 , typename H | |
669 , typename I | |
670 , typename J | |
671 , typename K | |
672 , typename L | |
673 , typename M | |
674 , typename N | |
675 , typename O | |
676 > | |
677 struct result { typedef T* type; }; | |
678 | |
679 | |
680 template < | |
681 typename A, typename B, typename C, typename D, typename E, | |
682 typename F, typename G, typename H, typename I, typename J, | |
683 typename K, typename L, typename M, typename N, typename O | |
684 > | |
685 T* operator()( | |
686 A const& a, B const& b, C const& c, D const& d, E const& e, | |
687 F const& f, G const& g, H const& h, I const& i, J const& j, | |
688 K const& k, L const& l, M const& m, N const& n, O const& o) const | |
689 { | |
690 return new T(a, b, c, d, f, e, g, h, i, j, k, l, m, n, o); | |
691 } | |
692 | |
693 }; | |
694 #endif | |
695 | |
696 | |
697 #if defined(__BORLANDC__) || (defined(__MWERKS__) && (__MWERKS__ <= 0x3002)) | |
698 | |
699 /////////////////////////////////////////////////////////////////////////////// | |
700 // | |
701 // The following specializations are needed because Borland and CodeWarrior | |
702 // does not accept default template arguments in nested template classes in | |
703 // classes (i.e new_l::result) | |
704 // | |
705 /////////////////////////////////////////////////////////////////////////////// | |
706 template <typename T, typename TupleT> | |
707 struct composite0_result<new_l_0<T>, TupleT> { | |
708 | |
709 typedef T* type; | |
710 }; | |
711 | |
712 ////////////////////////////////// | |
713 template <typename T, typename TupleT, | |
714 typename A> | |
715 struct composite1_result<new_l<T>, TupleT, A> { | |
716 | |
717 typedef T* type; | |
718 }; | |
719 | |
720 ////////////////////////////////// | |
721 template <typename T, typename TupleT, | |
722 typename A, typename B> | |
723 struct composite2_result<new_l<T>, TupleT, A, B> { | |
724 | |
725 typedef T* type; | |
726 }; | |
727 | |
728 ////////////////////////////////// | |
729 template <typename T, typename TupleT, | |
730 typename A, typename B, typename C> | |
731 struct composite3_result<new_l<T>, TupleT, A, B, C> { | |
732 | |
733 typedef T* type; | |
734 }; | |
735 | |
736 #if PHOENIX_LIMIT > 3 | |
737 ////////////////////////////////// | |
738 template <typename T, typename TupleT, | |
739 typename A, typename B, typename C, typename D> | |
740 struct composite4_result<new_l<T>, TupleT, | |
741 A, B, C, D> { | |
742 | |
743 typedef T* type; | |
744 }; | |
745 | |
746 ////////////////////////////////// | |
747 template <typename T, typename TupleT, | |
748 typename A, typename B, typename C, typename D, typename E> | |
749 struct composite5_result<new_l<T>, TupleT, | |
750 A, B, C, D, E> { | |
751 | |
752 typedef T* type; | |
753 }; | |
754 | |
755 ////////////////////////////////// | |
756 template <typename T, typename TupleT, | |
757 typename A, typename B, typename C, typename D, typename E, | |
758 typename F> | |
759 struct composite6_result<new_l<T>, TupleT, | |
760 A, B, C, D, E, F> { | |
761 | |
762 typedef T* type; | |
763 }; | |
764 | |
765 #if PHOENIX_LIMIT > 6 | |
766 ////////////////////////////////// | |
767 template <typename T, typename TupleT, | |
768 typename A, typename B, typename C, typename D, typename E, | |
769 typename F, typename G> | |
770 struct composite7_result<new_l<T>, TupleT, | |
771 A, B, C, D, E, F, G> { | |
772 | |
773 typedef T* type; | |
774 }; | |
775 | |
776 ////////////////////////////////// | |
777 template <typename T, typename TupleT, | |
778 typename A, typename B, typename C, typename D, typename E, | |
779 typename F, typename G, typename H> | |
780 struct composite8_result<new_l<T>, TupleT, | |
781 A, B, C, D, E, F, G, H> { | |
782 | |
783 typedef T* type; | |
784 }; | |
785 | |
786 ////////////////////////////////// | |
787 template <typename T, typename TupleT, | |
788 typename A, typename B, typename C, typename D, typename E, | |
789 typename F, typename G, typename H, typename I> | |
790 struct composite9_result<new_l<T>, TupleT, | |
791 A, B, C, D, E, F, G, H, I> { | |
792 | |
793 typedef T* type; | |
794 }; | |
795 | |
796 #if PHOENIX_LIMIT > 9 | |
797 ////////////////////////////////// | |
798 template <typename T, typename TupleT, | |
799 typename A, typename B, typename C, typename D, typename E, | |
800 typename F, typename G, typename H, typename I, typename J> | |
801 struct composite10_result<new_l<T>, TupleT, | |
802 A, B, C, D, E, F, G, H, I, J> { | |
803 | |
804 typedef T* type; | |
805 }; | |
806 | |
807 ////////////////////////////////// | |
808 template <typename T, typename TupleT, | |
809 typename A, typename B, typename C, typename D, typename E, | |
810 typename F, typename G, typename H, typename I, typename J, | |
811 typename K> | |
812 struct composite11_result<new_l<T>, TupleT, | |
813 A, B, C, D, E, F, G, H, I, J, K> { | |
814 | |
815 typedef T* type; | |
816 }; | |
817 | |
818 ////////////////////////////////// | |
819 template <typename T, typename TupleT, | |
820 typename A, typename B, typename C, typename D, typename E, | |
821 typename F, typename G, typename H, typename I, typename J, | |
822 typename K, typename L> | |
823 struct composite12_result<new_l<T>, TupleT, | |
824 A, B, C, D, E, F, G, H, I, J, K, L> { | |
825 | |
826 typedef T* type; | |
827 }; | |
828 | |
829 #if PHOENIX_LIMIT > 12 | |
830 ////////////////////////////////// | |
831 template <typename T, typename TupleT, | |
832 typename A, typename B, typename C, typename D, typename E, | |
833 typename F, typename G, typename H, typename I, typename J, | |
834 typename K, typename L, typename M> | |
835 struct composite13_result<new_l<T>, TupleT, | |
836 A, B, C, D, E, F, G, H, I, J, K, L, M> { | |
837 | |
838 typedef T* type; | |
839 }; | |
840 | |
841 ////////////////////////////////// | |
842 template <typename T, typename TupleT, | |
843 typename A, typename B, typename C, typename D, typename E, | |
844 typename F, typename G, typename H, typename I, typename J, | |
845 typename K, typename L, typename M, typename N> | |
846 struct composite14_result<new_l<T>, TupleT, | |
847 A, B, C, D, E, F, G, H, I, J, K, L, M, N> { | |
848 | |
849 typedef T* type; | |
850 }; | |
851 | |
852 ////////////////////////////////// | |
853 template <typename T, typename TupleT, | |
854 typename A, typename B, typename C, typename D, typename E, | |
855 typename F, typename G, typename H, typename I, typename J, | |
856 typename K, typename L, typename M, typename N, typename O> | |
857 struct composite15_result<new_l<T>, TupleT, | |
858 A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> { | |
859 | |
860 typedef T* type; | |
861 }; | |
862 | |
863 #endif | |
864 #endif | |
865 #endif | |
866 #endif | |
867 #endif | |
868 | |
869 ////////////////////////////////// | |
870 template <typename T> | |
871 inline typename impl::make_composite<new_l_0<T> >::type | |
872 new_() | |
873 { | |
874 typedef impl::make_composite<new_l_0<T> > make_composite_t; | |
875 typedef typename make_composite_t::type type_t; | |
876 typedef typename make_composite_t::composite_type composite_type_t; | |
877 | |
878 return type_t(composite_type_t(new_l_0<T>())); | |
879 } | |
880 | |
881 ////////////////////////////////// | |
882 template <typename T, typename A> | |
883 inline typename impl::make_composite<new_1<T>, A>::type | |
884 new_(A const& a) | |
885 { | |
886 typedef impl::make_composite<new_1<T>, A> make_composite_t; | |
887 typedef typename make_composite_t::type type_t; | |
888 typedef typename make_composite_t::composite_type composite_type_t; | |
889 | |
890 return type_t(composite_type_t(new_1<T>(), | |
891 as_actor<A>::convert(a) | |
892 )); | |
893 } | |
894 | |
895 ////////////////////////////////// | |
896 template <typename T, typename A, typename B> | |
897 inline typename impl::make_composite<new_2<T>, A, B>::type | |
898 new_(A const& a, B const& b) | |
899 { | |
900 typedef impl::make_composite<new_2<T>, A, B> make_composite_t; | |
901 typedef typename make_composite_t::type type_t; | |
902 typedef typename make_composite_t::composite_type composite_type_t; | |
903 | |
904 return type_t(composite_type_t(new_2<T>(), | |
905 as_actor<A>::convert(a), | |
906 as_actor<B>::convert(b) | |
907 )); | |
908 } | |
909 | |
910 ////////////////////////////////// | |
911 template <typename T, typename A, typename B, typename C> | |
912 inline typename impl::make_composite<new_3<T>, A, B, C>::type | |
913 new_(A const& a, B const& b, C const& c) | |
914 { | |
915 typedef impl::make_composite<new_3<T>, A, B, C> make_composite_t; | |
916 typedef typename make_composite_t::type type_t; | |
917 typedef typename make_composite_t::composite_type composite_type_t; | |
918 | |
919 return type_t(composite_type_t(new_3<T>(), | |
920 as_actor<A>::convert(a), | |
921 as_actor<B>::convert(b), | |
922 as_actor<C>::convert(c) | |
923 )); | |
924 } | |
925 | |
926 #if PHOENIX_CONSTRUCT_LIMIT > 3 | |
927 ////////////////////////////////// | |
928 template < | |
929 typename T, typename A, typename B, typename C, typename D | |
930 > | |
931 inline typename impl::make_composite<new_4<T>, A, B, C, D>::type | |
932 new_( | |
933 A const& a, B const& b, C const& c, D const& d) | |
934 { | |
935 typedef | |
936 impl::make_composite<new_4<T>, A, B, C, D> | |
937 make_composite_t; | |
938 typedef typename make_composite_t::type type_t; | |
939 typedef typename make_composite_t::composite_type composite_type_t; | |
940 | |
941 return type_t(composite_type_t(new_4<T>(), | |
942 as_actor<A>::convert(a), | |
943 as_actor<B>::convert(b), | |
944 as_actor<C>::convert(c), | |
945 as_actor<D>::convert(d) | |
946 )); | |
947 } | |
948 | |
949 ////////////////////////////////// | |
950 template < | |
951 typename T, typename A, typename B, typename C, typename D, typename E | |
952 > | |
953 inline typename impl::make_composite<new_5<T>, A, B, C, D, E>::type | |
954 new_( | |
955 A const& a, B const& b, C const& c, D const& d, E const& e) | |
956 { | |
957 typedef | |
958 impl::make_composite<new_5<T>, A, B, C, D, E> | |
959 make_composite_t; | |
960 typedef typename make_composite_t::type type_t; | |
961 typedef typename make_composite_t::composite_type composite_type_t; | |
962 | |
963 return type_t(composite_type_t(new_5<T>(), | |
964 as_actor<A>::convert(a), | |
965 as_actor<B>::convert(b), | |
966 as_actor<C>::convert(c), | |
967 as_actor<D>::convert(d), | |
968 as_actor<E>::convert(e) | |
969 )); | |
970 } | |
971 | |
972 ////////////////////////////////// | |
973 template < | |
974 typename T, typename A, typename B, typename C, typename D, typename E, | |
975 typename F | |
976 > | |
977 inline typename impl::make_composite<new_6<T>, A, B, C, D, E, F>::type | |
978 new_( | |
979 A const& a, B const& b, C const& c, D const& d, E const& e, | |
980 F const& f) | |
981 { | |
982 typedef | |
983 impl::make_composite<new_6<T>, A, B, C, D, E, F> | |
984 make_composite_t; | |
985 typedef typename make_composite_t::type type_t; | |
986 typedef typename make_composite_t::composite_type composite_type_t; | |
987 | |
988 return type_t(composite_type_t(new_6<T>(), | |
989 as_actor<A>::convert(a), | |
990 as_actor<B>::convert(b), | |
991 as_actor<C>::convert(c), | |
992 as_actor<D>::convert(d), | |
993 as_actor<E>::convert(e), | |
994 as_actor<F>::convert(f) | |
995 )); | |
996 } | |
997 | |
998 #if PHOENIX_CONSTRUCT_LIMIT > 6 | |
999 ////////////////////////////////// | |
1000 template < | |
1001 typename T, typename A, typename B, typename C, typename D, typename E, | |
1002 typename F, typename G | |
1003 > | |
1004 inline typename impl::make_composite<new_7<T>, A, B, C, D, E, F, G>::type | |
1005 new_( | |
1006 A const& a, B const& b, C const& c, D const& d, E const& e, | |
1007 F const& f, G const& g) | |
1008 { | |
1009 typedef | |
1010 impl::make_composite<new_7<T>, A, B, C, D, E, F, G> | |
1011 make_composite_t; | |
1012 typedef typename make_composite_t::type type_t; | |
1013 typedef typename make_composite_t::composite_type composite_type_t; | |
1014 | |
1015 return type_t(composite_type_t(new_7<T>(), | |
1016 as_actor<A>::convert(a), | |
1017 as_actor<B>::convert(b), | |
1018 as_actor<C>::convert(c), | |
1019 as_actor<D>::convert(d), | |
1020 as_actor<E>::convert(e), | |
1021 as_actor<F>::convert(f), | |
1022 as_actor<G>::convert(g) | |
1023 )); | |
1024 } | |
1025 | |
1026 ////////////////////////////////// | |
1027 template < | |
1028 typename T, typename A, typename B, typename C, typename D, typename E, | |
1029 typename F, typename G, typename H | |
1030 > | |
1031 inline typename impl::make_composite<new_8<T>, A, B, C, D, E, F, G, H>::type | |
1032 new_( | |
1033 A const& a, B const& b, C const& c, D const& d, E const& e, | |
1034 F const& f, G const& g, H const& h) | |
1035 { | |
1036 typedef | |
1037 impl::make_composite<new_8<T>, A, B, C, D, E, F, G, H> | |
1038 make_composite_t; | |
1039 typedef typename make_composite_t::type type_t; | |
1040 typedef typename make_composite_t::composite_type composite_type_t; | |
1041 | |
1042 return type_t(composite_type_t(new_8<T>(), | |
1043 as_actor<A>::convert(a), | |
1044 as_actor<B>::convert(b), | |
1045 as_actor<C>::convert(c), | |
1046 as_actor<D>::convert(d), | |
1047 as_actor<E>::convert(e), | |
1048 as_actor<F>::convert(f), | |
1049 as_actor<G>::convert(g), | |
1050 as_actor<H>::convert(h) | |
1051 )); | |
1052 } | |
1053 | |
1054 ////////////////////////////////// | |
1055 template < | |
1056 typename T, typename A, typename B, typename C, typename D, typename E, | |
1057 typename F, typename G, typename H, typename I | |
1058 > | |
1059 inline typename impl::make_composite<new_9<T>, A, B, C, D, E, F, G, H, I>::type | |
1060 new_( | |
1061 A const& a, B const& b, C const& c, D const& d, E const& e, | |
1062 F const& f, G const& g, H const& h, I const& i) | |
1063 { | |
1064 typedef | |
1065 impl::make_composite<new_9<T>, A, B, C, D, E, F, G, H, I> | |
1066 make_composite_t; | |
1067 typedef typename make_composite_t::type type_t; | |
1068 typedef typename make_composite_t::composite_type composite_type_t; | |
1069 | |
1070 return type_t(composite_type_t(new_9<T>(), | |
1071 as_actor<A>::convert(a), | |
1072 as_actor<B>::convert(b), | |
1073 as_actor<C>::convert(c), | |
1074 as_actor<D>::convert(d), | |
1075 as_actor<E>::convert(e), | |
1076 as_actor<F>::convert(f), | |
1077 as_actor<G>::convert(g), | |
1078 as_actor<H>::convert(h), | |
1079 as_actor<I>::convert(i) | |
1080 )); | |
1081 } | |
1082 | |
1083 #if PHOENIX_CONSTRUCT_LIMIT > 9 | |
1084 ////////////////////////////////// | |
1085 template < | |
1086 typename T, typename A, typename B, typename C, typename D, typename E, | |
1087 typename F, typename G, typename H, typename I, typename J | |
1088 > | |
1089 inline typename impl::make_composite< | |
1090 new_10<T>, A, B, C, D, E, F, G, H, I, J>::type | |
1091 new_( | |
1092 A const& a, B const& b, C const& c, D const& d, E const& e, | |
1093 F const& f, G const& g, H const& h, I const& i, J const& j) | |
1094 { | |
1095 typedef | |
1096 impl::make_composite< | |
1097 new_10<T>, A, B, C, D, E, F, G, H, I, J | |
1098 > | |
1099 make_composite_t; | |
1100 typedef typename make_composite_t::type type_t; | |
1101 typedef typename make_composite_t::composite_type composite_type_t; | |
1102 | |
1103 return type_t(composite_type_t(new_10<T>(), | |
1104 as_actor<A>::convert(a), | |
1105 as_actor<B>::convert(b), | |
1106 as_actor<C>::convert(c), | |
1107 as_actor<D>::convert(d), | |
1108 as_actor<E>::convert(e), | |
1109 as_actor<F>::convert(f), | |
1110 as_actor<G>::convert(g), | |
1111 as_actor<H>::convert(h), | |
1112 as_actor<I>::convert(i), | |
1113 as_actor<J>::convert(j) | |
1114 )); | |
1115 } | |
1116 | |
1117 ////////////////////////////////// | |
1118 template < | |
1119 typename T, typename A, typename B, typename C, typename D, typename E, | |
1120 typename F, typename G, typename H, typename I, typename J, typename K | |
1121 > | |
1122 inline typename impl::make_composite< | |
1123 new_11<T>, A, B, C, D, E, F, G, H, I, J, K>::type | |
1124 new_( | |
1125 A const& a, B const& b, C const& c, D const& d, E const& e, | |
1126 F const& f, G const& g, H const& h, I const& i, J const& j, | |
1127 K const& k) | |
1128 { | |
1129 typedef | |
1130 impl::make_composite< | |
1131 new_11<T>, A, B, C, D, E, F, G, H, I, J, K | |
1132 > | |
1133 make_composite_t; | |
1134 typedef typename make_composite_t::type type_t; | |
1135 typedef typename make_composite_t::composite_type composite_type_t; | |
1136 | |
1137 return type_t(composite_type_t(new_11<T>(), | |
1138 as_actor<A>::convert(a), | |
1139 as_actor<B>::convert(b), | |
1140 as_actor<C>::convert(c), | |
1141 as_actor<D>::convert(d), | |
1142 as_actor<E>::convert(e), | |
1143 as_actor<F>::convert(f), | |
1144 as_actor<G>::convert(g), | |
1145 as_actor<H>::convert(h), | |
1146 as_actor<I>::convert(i), | |
1147 as_actor<J>::convert(j), | |
1148 as_actor<K>::convert(k) | |
1149 )); | |
1150 } | |
1151 | |
1152 ////////////////////////////////// | |
1153 template < | |
1154 typename T, typename A, typename B, typename C, typename D, typename E, | |
1155 typename F, typename G, typename H, typename I, typename J, typename K, | |
1156 typename L | |
1157 > | |
1158 inline typename impl::make_composite< | |
1159 new_12<T>, A, B, C, D, E, F, G, H, I, J, K, L>::type | |
1160 new_( | |
1161 A const& a, B const& b, C const& c, D const& d, E const& e, | |
1162 F const& f, G const& g, H const& h, I const& i, J const& j, | |
1163 K const& k, L const& l) | |
1164 { | |
1165 typedef | |
1166 impl::make_composite< | |
1167 new_12<T>, A, B, C, D, E, F, G, H, I, J, K, L | |
1168 > | |
1169 make_composite_t; | |
1170 typedef typename make_composite_t::type type_t; | |
1171 typedef typename make_composite_t::composite_type composite_type_t; | |
1172 | |
1173 return type_t(composite_type_t(new_12<T>(), | |
1174 as_actor<A>::convert(a), | |
1175 as_actor<B>::convert(b), | |
1176 as_actor<C>::convert(c), | |
1177 as_actor<D>::convert(d), | |
1178 as_actor<E>::convert(e), | |
1179 as_actor<F>::convert(f), | |
1180 as_actor<G>::convert(g), | |
1181 as_actor<H>::convert(h), | |
1182 as_actor<I>::convert(i), | |
1183 as_actor<J>::convert(j), | |
1184 as_actor<K>::convert(k), | |
1185 as_actor<L>::convert(l) | |
1186 )); | |
1187 } | |
1188 | |
1189 #if PHOENIX_CONSTRUCT_LIMIT > 12 | |
1190 ////////////////////////////////// | |
1191 template < | |
1192 typename T, typename A, typename B, typename C, typename D, typename E, | |
1193 typename F, typename G, typename H, typename I, typename J, typename K, | |
1194 typename L, typename M | |
1195 > | |
1196 inline typename impl::make_composite< | |
1197 new_13<T>, A, B, C, D, E, F, G, H, I, J, K, L, M>::type | |
1198 new_( | |
1199 A const& a, B const& b, C const& c, D const& d, E const& e, | |
1200 F const& f, G const& g, H const& h, I const& i, J const& j, | |
1201 K const& k, L const& l, M const& m) | |
1202 { | |
1203 typedef | |
1204 impl::make_composite< | |
1205 new_13<T>, A, B, C, D, E, F, G, H, I, J, K, L, M | |
1206 > | |
1207 make_composite_t; | |
1208 typedef typename make_composite_t::type type_t; | |
1209 typedef typename make_composite_t::composite_type composite_type_t; | |
1210 | |
1211 return type_t(composite_type_t(new_13<T>(), | |
1212 as_actor<A>::convert(a), | |
1213 as_actor<B>::convert(b), | |
1214 as_actor<C>::convert(c), | |
1215 as_actor<D>::convert(d), | |
1216 as_actor<E>::convert(e), | |
1217 as_actor<F>::convert(f), | |
1218 as_actor<G>::convert(g), | |
1219 as_actor<H>::convert(h), | |
1220 as_actor<I>::convert(i), | |
1221 as_actor<J>::convert(j), | |
1222 as_actor<K>::convert(k), | |
1223 as_actor<L>::convert(l), | |
1224 as_actor<M>::convert(m) | |
1225 )); | |
1226 } | |
1227 | |
1228 ////////////////////////////////// | |
1229 template < | |
1230 typename T, typename A, typename B, typename C, typename D, typename E, | |
1231 typename F, typename G, typename H, typename I, typename J, typename K, | |
1232 typename L, typename M, typename N | |
1233 > | |
1234 inline typename impl::make_composite< | |
1235 new_14<T>, A, B, C, D, E, F, G, H, I, J, K, L, M>::type | |
1236 new_( | |
1237 A const& a, B const& b, C const& c, D const& d, E const& e, | |
1238 F const& f, G const& g, H const& h, I const& i, J const& j, | |
1239 K const& k, L const& l, M const& m, N const& n) | |
1240 { | |
1241 typedef | |
1242 impl::make_composite< | |
1243 new_14<T>, A, B, C, D, E, F, G, H, I, J, K, L, M, N | |
1244 > | |
1245 make_composite_t; | |
1246 typedef typename make_composite_t::type type_t; | |
1247 typedef typename make_composite_t::composite_type composite_type_t; | |
1248 | |
1249 return type_t(composite_type_t(new_14<T>(), | |
1250 as_actor<A>::convert(a), | |
1251 as_actor<B>::convert(b), | |
1252 as_actor<C>::convert(c), | |
1253 as_actor<D>::convert(d), | |
1254 as_actor<E>::convert(e), | |
1255 as_actor<F>::convert(f), | |
1256 as_actor<G>::convert(g), | |
1257 as_actor<H>::convert(h), | |
1258 as_actor<I>::convert(i), | |
1259 as_actor<J>::convert(j), | |
1260 as_actor<K>::convert(k), | |
1261 as_actor<L>::convert(l), | |
1262 as_actor<M>::convert(m), | |
1263 as_actor<N>::convert(n) | |
1264 )); | |
1265 } | |
1266 | |
1267 ////////////////////////////////// | |
1268 template < | |
1269 typename T, typename A, typename B, typename C, typename D, typename E, | |
1270 typename F, typename G, typename H, typename I, typename J, typename K, | |
1271 typename L, typename M, typename N, typename O | |
1272 > | |
1273 inline typename impl::make_composite< | |
1274 new_15<T>, A, B, C, D, E, F, G, H, I, J, K, L, M, O>::type | |
1275 new_( | |
1276 A const& a, B const& b, C const& c, D const& d, E const& e, | |
1277 F const& f, G const& g, H const& h, I const& i, J const& j, | |
1278 K const& k, L const& l, M const& m, N const& n, O const& o) | |
1279 { | |
1280 typedef | |
1281 impl::make_composite< | |
1282 new_15<T>, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O | |
1283 > | |
1284 make_composite_t; | |
1285 typedef typename make_composite_t::type type_t; | |
1286 typedef typename make_composite_t::composite_type composite_type_t; | |
1287 | |
1288 return type_t(composite_type_t(new_15<T>(), | |
1289 as_actor<A>::convert(a), | |
1290 as_actor<B>::convert(b), | |
1291 as_actor<C>::convert(c), | |
1292 as_actor<D>::convert(d), | |
1293 as_actor<E>::convert(e), | |
1294 as_actor<F>::convert(f), | |
1295 as_actor<G>::convert(g), | |
1296 as_actor<H>::convert(h), | |
1297 as_actor<I>::convert(i), | |
1298 as_actor<J>::convert(j), | |
1299 as_actor<K>::convert(k), | |
1300 as_actor<L>::convert(l), | |
1301 as_actor<M>::convert(m), | |
1302 as_actor<N>::convert(n), | |
1303 as_actor<O>::convert(o) | |
1304 )); | |
1305 } | |
1306 | |
1307 #endif | |
1308 #endif | |
1309 #endif | |
1310 #endif | |
1311 | |
1312 /////////////////////////////////////////////////////////////////////////////// | |
1313 } // namespace phoenix | |
1314 | |
1315 #endif // PHOENIX_NEW_HPP |