source: NonGTP/Boost/boost/spirit/phoenix/casts.hpp @ 857

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