Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/spirit/home/classic/phoenix/tuples.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children | c530137014c0 |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 /*============================================================================= | |
2 Phoenix V1.2.1 | |
3 Copyright (c) 2001-2002 Joel de Guzman | |
4 | |
5 Distributed under the Boost Software License, Version 1.0. (See accompanying | |
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
7 ==============================================================================*/ | |
8 #ifndef PHOENIX_TUPLES_HPP | |
9 #define PHOENIX_TUPLES_HPP | |
10 | |
11 #if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) | |
12 #error "Sorry, Phoenix does not support VC6 and VC7. Please upgrade to at least VC7.1" | |
13 #endif | |
14 | |
15 /////////////////////////////////////////////////////////////////////////////// | |
16 // | |
17 // Phoenix predefined maximum limit. This limit defines the maximum | |
18 // number of elements a tuple can hold. This number defaults to 3. The | |
19 // actual maximum is rounded up in multiples of 3. Thus, if this value | |
20 // is 4, the actual limit is 6. The ultimate maximum limit in this | |
21 // implementation is 15. | |
22 // | |
23 /////////////////////////////////////////////////////////////////////////////// | |
24 #ifndef PHOENIX_LIMIT | |
25 #define PHOENIX_LIMIT 3 | |
26 #endif | |
27 | |
28 #if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561) | |
29 namespace phoenix { namespace borland_only | |
30 { | |
31 namespace ftors | |
32 { | |
33 // We define these dummy template functions. Borland complains when | |
34 // a template class has the same name as a template function, | |
35 // regardless if they are in different namespaces. | |
36 | |
37 template <typename T> void if_(T) {} | |
38 template <typename T> void for_(T) {} | |
39 template <typename T> void while_(T) {} | |
40 template <typename T> void do_(T) {} | |
41 } | |
42 | |
43 namespace tmpls | |
44 { | |
45 // We define these dummy template functions. Borland complains when | |
46 // a template class has the same name as a template function, | |
47 // regardless if they are in different namespaces. | |
48 | |
49 template <typename T> struct if_ {}; | |
50 template <typename T> struct for_ {}; | |
51 template <typename T> struct while_ {}; | |
52 template <typename T> struct do_ {}; | |
53 } | |
54 | |
55 }} // namespace phoenix::borland_only | |
56 #endif | |
57 | |
58 /////////////////////////////////////////////////////////////////////////////// | |
59 #include <boost/static_assert.hpp> | |
60 #include <boost/call_traits.hpp> | |
61 #include <boost/type_traits/remove_reference.hpp> | |
62 | |
63 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) | |
64 #pragma warning(push) | |
65 #pragma warning(disable:4512) //assignment operator could not be generated | |
66 #endif | |
67 | |
68 /////////////////////////////////////////////////////////////////////////////// | |
69 namespace phoenix { | |
70 | |
71 /////////////////////////////////////////////////////////////////////////////// | |
72 // | |
73 // tuple | |
74 // | |
75 // Tuples hold heterogeneous types up to a predefined maximum. Only | |
76 // the most basic functionality needed is provided. Unlike other | |
77 // recursive list-like tuple implementations, this tuple | |
78 // implementation uses simple structs similar to std::pair with | |
79 // specialization for 0 to N tuple elements. | |
80 // | |
81 // 1) Construction | |
82 // Here are examples on how to construct tuples: | |
83 // | |
84 // typedef tuple<int, char> t1_t; | |
85 // typedef tuple<int, std::string, double> t2_t; | |
86 // | |
87 // // this tuple has an int and char members | |
88 // t1_t t1(3, 'c'); | |
89 // | |
90 // // this tuple has an int, std::string and double members | |
91 // t2_t t2(3, "hello", 3.14); | |
92 // | |
93 // Tuples can also be constructed from other tuples. The | |
94 // source and destination tuples need not have exactly the | |
95 // same element types. The only requirement is that the | |
96 // source tuple have the same number of elements as the | |
97 // destination and that each element slot in the | |
98 // destination can be copy constructed from the source | |
99 // element. For example: | |
100 // | |
101 // tuple<double, double> t3(t1); // OK. Compatible tuples | |
102 // tuple<double, double> t4(t2); // Error! Incompatible tuples | |
103 // | |
104 // 2) Member access | |
105 // A member in a tuple can be accessed using the | |
106 // tuple's [] operator by specifying the Nth | |
107 // tuple_index. Here are some examples: | |
108 // | |
109 // tuple_index<0> ix0; // 0th index == 1st item | |
110 // tuple_index<1> ix1; // 1st index == 2nd item | |
111 // tuple_index<2> ix2; // 2nd index == 3rd item | |
112 // | |
113 // t1[ix0] = 33; // sets the int member of the tuple t1 | |
114 // t2[ix2] = 6e6; // sets the double member of the tuple t2 | |
115 // t1[ix1] = 'a'; // sets the char member of the tuple t1 | |
116 // | |
117 // There are some predefined names are provided in sub- | |
118 // namespace tuple_index_names: | |
119 // | |
120 // tuple_index<0> _1; | |
121 // tuple_index<1> _2; | |
122 // ... | |
123 // tuple_index<N> _N; | |
124 // | |
125 // These indexes may be used by 'using' namespace | |
126 // phoenix::tuple_index_names. | |
127 // | |
128 // Access to out of bound indexes returns a nil_t value. | |
129 // | |
130 // 3) Member type inquiry | |
131 // The type of an individual member can be queried. | |
132 // Example: | |
133 // | |
134 // tuple_element<1, t2_t>::type | |
135 // | |
136 // Refers to the type of the second member (note zero based, | |
137 // thus 0 = 1st item, 1 = 2nd item) of the tuple. | |
138 // | |
139 // Aside from tuple_element<N, T>::type, there are two | |
140 // more types that tuple_element provides: rtype and | |
141 // crtype. While 'type' is the plain underlying type, | |
142 // 'rtype' is the reference type, or type& and 'crtype' | |
143 // is the constant reference type or type const&. The | |
144 // latter two are provided to make it easy for the | |
145 // client in dealing with the possibility of reference | |
146 // to reference when type is already a reference, which | |
147 // is illegal in C++. | |
148 // | |
149 // Access to out of bound indexes returns a nil_t type. | |
150 // | |
151 // 4) Tuple length | |
152 // The number of elements in a tuple can be queried. | |
153 // Example: | |
154 // | |
155 // int n = t1.length; | |
156 // | |
157 // gets the number of elements in tuple t1. | |
158 // | |
159 // length is a static constant. Thus, TupleT::length | |
160 // also works. Example: | |
161 // | |
162 // int n = t1_t::length; | |
163 // | |
164 /////////////////////////////////////////////////////////////////////////////// | |
165 struct nil_t {}; | |
166 using boost::remove_reference; | |
167 using boost::call_traits; | |
168 | |
169 ////////////////////////////////// | |
170 namespace impl { | |
171 | |
172 template <typename T> | |
173 struct access { | |
174 | |
175 typedef const T& ctype; | |
176 typedef T& type; | |
177 }; | |
178 | |
179 template <typename T> | |
180 struct access<T&> { | |
181 | |
182 typedef T& ctype; | |
183 typedef T& type; | |
184 }; | |
185 } | |
186 | |
187 /////////////////////////////////////////////////////////////////////////////// | |
188 // | |
189 // tuple_element | |
190 // | |
191 // A query class that gets the Nth element inside a tuple. | |
192 // Examples: | |
193 // | |
194 // tuple_element<1, tuple<int, char, void*> >::type // plain | |
195 // tuple_element<1, tuple<int, char, void*> >::rtype // ref | |
196 // tuple_element<1, tuple<int, char, void*> >::crtype // const ref | |
197 // | |
198 // Has type char which is the 2nd type in the tuple | |
199 // (note zero based, thus 0 = 1st item, 1 = 2nd item). | |
200 // | |
201 // Given a tuple object, the static function tuple_element<N, | |
202 // TupleT>::get(tuple) gets the Nth element in the tuple. The | |
203 // tuple class' tuple::operator[] uses this to get its Nth | |
204 // element. | |
205 // | |
206 /////////////////////////////////////////////////////////////////////////////// | |
207 template <int N, typename TupleT> | |
208 struct tuple_element | |
209 { | |
210 typedef nil_t type; | |
211 typedef nil_t& rtype; | |
212 typedef nil_t const& crtype; | |
213 | |
214 static nil_t get(TupleT const& t) { return nil_t(); } | |
215 }; | |
216 | |
217 ////////////////////////////////// | |
218 template <typename TupleT> | |
219 struct tuple_element<0, TupleT> | |
220 { | |
221 typedef typename TupleT::a_type type; | |
222 typedef typename impl::access<type>::type rtype; | |
223 typedef typename impl::access<type>::ctype crtype; | |
224 | |
225 static rtype get(TupleT& t) { return t.a; } | |
226 static crtype get(TupleT const& t) { return t.a; } | |
227 }; | |
228 | |
229 ////////////////////////////////// | |
230 template <typename TupleT> | |
231 struct tuple_element<1, TupleT> | |
232 { | |
233 typedef typename TupleT::b_type type; | |
234 typedef typename impl::access<type>::type rtype; | |
235 typedef typename impl::access<type>::ctype crtype; | |
236 | |
237 static rtype get(TupleT& t) { return t.b; } | |
238 static crtype get(TupleT const& t) { return t.b; } | |
239 }; | |
240 | |
241 ////////////////////////////////// | |
242 template <typename TupleT> | |
243 struct tuple_element<2, TupleT> | |
244 { | |
245 typedef typename TupleT::c_type type; | |
246 typedef typename impl::access<type>::type rtype; | |
247 typedef typename impl::access<type>::ctype crtype; | |
248 | |
249 static rtype get(TupleT& t) { return t.c; } | |
250 static crtype get(TupleT const& t) { return t.c; } | |
251 }; | |
252 | |
253 #if PHOENIX_LIMIT > 3 | |
254 ////////////////////////////////// | |
255 template <typename TupleT> | |
256 struct tuple_element<3, TupleT> | |
257 { | |
258 typedef typename TupleT::d_type type; | |
259 typedef typename impl::access<type>::type rtype; | |
260 typedef typename impl::access<type>::ctype crtype; | |
261 | |
262 static rtype get(TupleT& t) { return t.d; } | |
263 static crtype get(TupleT const& t) { return t.d; } | |
264 }; | |
265 | |
266 ////////////////////////////////// | |
267 template <typename TupleT> | |
268 struct tuple_element<4, TupleT> | |
269 { | |
270 typedef typename TupleT::e_type type; | |
271 typedef typename impl::access<type>::type rtype; | |
272 typedef typename impl::access<type>::ctype crtype; | |
273 | |
274 static rtype get(TupleT& t) { return t.e; } | |
275 static crtype get(TupleT const& t) { return t.e; } | |
276 }; | |
277 | |
278 ////////////////////////////////// | |
279 template <typename TupleT> | |
280 struct tuple_element<5, TupleT> | |
281 { | |
282 typedef typename TupleT::f_type type; | |
283 typedef typename impl::access<type>::type rtype; | |
284 typedef typename impl::access<type>::ctype crtype; | |
285 | |
286 static rtype get(TupleT& t) { return t.f; } | |
287 static crtype get(TupleT const& t) { return t.f; } | |
288 }; | |
289 | |
290 #if PHOENIX_LIMIT > 6 | |
291 ////////////////////////////////// | |
292 template <typename TupleT> | |
293 struct tuple_element<6, TupleT> | |
294 { | |
295 typedef typename TupleT::g_type type; | |
296 typedef typename impl::access<type>::type rtype; | |
297 typedef typename impl::access<type>::ctype crtype; | |
298 | |
299 static rtype get(TupleT& t) { return t.g; } | |
300 static crtype get(TupleT const& t) { return t.g; } | |
301 }; | |
302 | |
303 ////////////////////////////////// | |
304 template <typename TupleT> | |
305 struct tuple_element<7, TupleT> | |
306 { | |
307 typedef typename TupleT::h_type type; | |
308 typedef typename impl::access<type>::type rtype; | |
309 typedef typename impl::access<type>::ctype crtype; | |
310 | |
311 static rtype get(TupleT& t) { return t.h; } | |
312 static crtype get(TupleT const& t) { return t.h; } | |
313 }; | |
314 | |
315 ////////////////////////////////// | |
316 template <typename TupleT> | |
317 struct tuple_element<8, TupleT> | |
318 { | |
319 typedef typename TupleT::i_type type; | |
320 typedef typename impl::access<type>::type rtype; | |
321 typedef typename impl::access<type>::ctype crtype; | |
322 | |
323 static rtype get(TupleT& t) { return t.i; } | |
324 static crtype get(TupleT const& t) { return t.i; } | |
325 }; | |
326 | |
327 #if PHOENIX_LIMIT > 9 | |
328 ////////////////////////////////// | |
329 template <typename TupleT> | |
330 struct tuple_element<9, TupleT> | |
331 { | |
332 typedef typename TupleT::j_type type; | |
333 typedef typename impl::access<type>::type rtype; | |
334 typedef typename impl::access<type>::ctype crtype; | |
335 | |
336 static rtype get(TupleT& t) { return t.j; } | |
337 static crtype get(TupleT const& t) { return t.j; } | |
338 }; | |
339 | |
340 ////////////////////////////////// | |
341 template <typename TupleT> | |
342 struct tuple_element<10, TupleT> | |
343 { | |
344 typedef typename TupleT::k_type type; | |
345 typedef typename impl::access<type>::type rtype; | |
346 typedef typename impl::access<type>::ctype crtype; | |
347 | |
348 static rtype get(TupleT& t) { return t.k; } | |
349 static crtype get(TupleT const& t) { return t.k; } | |
350 }; | |
351 | |
352 ////////////////////////////////// | |
353 template <typename TupleT> | |
354 struct tuple_element<11, TupleT> | |
355 { | |
356 typedef typename TupleT::l_type type; | |
357 typedef typename impl::access<type>::type rtype; | |
358 typedef typename impl::access<type>::ctype crtype; | |
359 | |
360 static rtype get(TupleT& t) { return t.l; } | |
361 static crtype get(TupleT const& t) { return t.l; } | |
362 }; | |
363 | |
364 #if PHOENIX_LIMIT > 12 | |
365 ////////////////////////////////// | |
366 template <typename TupleT> | |
367 struct tuple_element<12, TupleT> | |
368 { | |
369 typedef typename TupleT::m_type type; | |
370 typedef typename impl::access<type>::type rtype; | |
371 typedef typename impl::access<type>::ctype crtype; | |
372 | |
373 static rtype get(TupleT& t) { return t.m; } | |
374 static crtype get(TupleT const& t) { return t.m; } | |
375 }; | |
376 | |
377 ////////////////////////////////// | |
378 template <typename TupleT> | |
379 struct tuple_element<13, TupleT> | |
380 { | |
381 typedef typename TupleT::n_type type; | |
382 typedef typename impl::access<type>::type rtype; | |
383 typedef typename impl::access<type>::ctype crtype; | |
384 | |
385 static rtype get(TupleT& t) { return t.n; } | |
386 static crtype get(TupleT const& t) { return t.n; } | |
387 }; | |
388 | |
389 ////////////////////////////////// | |
390 template <typename TupleT> | |
391 struct tuple_element<14, TupleT> | |
392 { | |
393 typedef typename TupleT::o_type type; | |
394 typedef typename impl::access<type>::type rtype; | |
395 typedef typename impl::access<type>::ctype crtype; | |
396 | |
397 static rtype get(TupleT& t) { return t.o; } | |
398 static crtype get(TupleT const& t) { return t.o; } | |
399 }; | |
400 | |
401 #endif | |
402 #endif | |
403 #endif | |
404 #endif | |
405 | |
406 /////////////////////////////////////////////////////////////////////////////// | |
407 // | |
408 // tuple forward declaration. | |
409 // | |
410 /////////////////////////////////////////////////////////////////////////////// | |
411 template < | |
412 typename A = nil_t | |
413 , typename B = nil_t | |
414 , typename C = nil_t | |
415 | |
416 #if PHOENIX_LIMIT > 3 | |
417 , typename D = nil_t | |
418 , typename E = nil_t | |
419 , typename F = nil_t | |
420 | |
421 #if PHOENIX_LIMIT > 6 | |
422 , typename G = nil_t | |
423 , typename H = nil_t | |
424 , typename I = nil_t | |
425 | |
426 #if PHOENIX_LIMIT > 9 | |
427 , typename J = nil_t | |
428 , typename K = nil_t | |
429 , typename L = nil_t | |
430 | |
431 #if PHOENIX_LIMIT > 12 | |
432 , typename M = nil_t | |
433 , typename N = nil_t | |
434 , typename O = nil_t | |
435 | |
436 #endif | |
437 #endif | |
438 #endif | |
439 #endif | |
440 | |
441 , typename NU = nil_t // Not used | |
442 > | |
443 struct tuple; | |
444 | |
445 /////////////////////////////////////////////////////////////////////////////// | |
446 // | |
447 // tuple_index | |
448 // | |
449 // This class wraps an integer in a type to be used for indexing | |
450 // the Nth element in a tuple. See tuple operator[]. Some | |
451 // predefined names are provided in sub-namespace | |
452 // tuple_index_names. | |
453 // | |
454 /////////////////////////////////////////////////////////////////////////////// | |
455 template <int N> | |
456 struct tuple_index {}; | |
457 | |
458 ////////////////////////////////// | |
459 namespace tuple_index_names { | |
460 | |
461 tuple_index<0> const _1 = tuple_index<0>(); | |
462 tuple_index<1> const _2 = tuple_index<1>(); | |
463 tuple_index<2> const _3 = tuple_index<2>(); | |
464 | |
465 #if PHOENIX_LIMIT > 3 | |
466 tuple_index<3> const _4 = tuple_index<3>(); | |
467 tuple_index<4> const _5 = tuple_index<4>(); | |
468 tuple_index<5> const _6 = tuple_index<5>(); | |
469 | |
470 #if PHOENIX_LIMIT > 6 | |
471 tuple_index<6> const _7 = tuple_index<6>(); | |
472 tuple_index<7> const _8 = tuple_index<7>(); | |
473 tuple_index<8> const _9 = tuple_index<8>(); | |
474 | |
475 #if PHOENIX_LIMIT > 9 | |
476 tuple_index<9> const _10 = tuple_index<9>(); | |
477 tuple_index<10> const _11 = tuple_index<10>(); | |
478 tuple_index<11> const _12 = tuple_index<11>(); | |
479 | |
480 #if PHOENIX_LIMIT > 12 | |
481 tuple_index<12> const _13 = tuple_index<12>(); | |
482 tuple_index<13> const _14 = tuple_index<13>(); | |
483 tuple_index<14> const _15 = tuple_index<14>(); | |
484 | |
485 #endif | |
486 #endif | |
487 #endif | |
488 #endif | |
489 } | |
490 | |
491 /////////////////////////////////////////////////////////////////////////////// | |
492 // | |
493 // tuple_common class | |
494 // | |
495 /////////////////////////////////////////////////////////////////////////////// | |
496 template <typename DerivedT> | |
497 struct tuple_base { | |
498 | |
499 typedef nil_t a_type; | |
500 typedef nil_t b_type; | |
501 typedef nil_t c_type; | |
502 | |
503 #if PHOENIX_LIMIT > 3 | |
504 typedef nil_t d_type; | |
505 typedef nil_t e_type; | |
506 typedef nil_t f_type; | |
507 | |
508 #if PHOENIX_LIMIT > 6 | |
509 typedef nil_t g_type; | |
510 typedef nil_t h_type; | |
511 typedef nil_t i_type; | |
512 | |
513 #if PHOENIX_LIMIT > 9 | |
514 typedef nil_t j_type; | |
515 typedef nil_t k_type; | |
516 typedef nil_t l_type; | |
517 | |
518 #if PHOENIX_LIMIT > 12 | |
519 typedef nil_t m_type; | |
520 typedef nil_t n_type; | |
521 typedef nil_t o_type; | |
522 | |
523 #endif | |
524 #endif | |
525 #endif | |
526 #endif | |
527 | |
528 template <int N> | |
529 typename tuple_element<N, DerivedT>::crtype | |
530 operator[](tuple_index<N>) const | |
531 { | |
532 return tuple_element<N, DerivedT> | |
533 ::get(*static_cast<DerivedT const*>(this)); | |
534 } | |
535 | |
536 template <int N> | |
537 typename tuple_element<N, DerivedT>::rtype | |
538 operator[](tuple_index<N>) | |
539 { | |
540 return tuple_element<N, DerivedT> | |
541 ::get(*static_cast<DerivedT*>(this)); | |
542 } | |
543 }; | |
544 | |
545 /////////////////////////////////////////////////////////////////////////////// | |
546 // | |
547 // tuple <0 member> class | |
548 // | |
549 /////////////////////////////////////////////////////////////////////////////// | |
550 template <> | |
551 struct tuple<> | |
552 : public tuple_base<tuple<> > { | |
553 | |
554 BOOST_STATIC_CONSTANT(int, length = 0); | |
555 }; | |
556 | |
557 /////////////////////////////////////////////////////////////////////////////// | |
558 // | |
559 // tuple <1 member> class | |
560 // | |
561 /////////////////////////////////////////////////////////////////////////////// | |
562 template <typename A> | |
563 struct tuple<A, nil_t, nil_t, | |
564 #if PHOENIX_LIMIT > 3 | |
565 nil_t, nil_t, nil_t, | |
566 #if PHOENIX_LIMIT > 6 | |
567 nil_t, nil_t, nil_t, | |
568 #if PHOENIX_LIMIT > 9 | |
569 nil_t, nil_t, nil_t, | |
570 #if PHOENIX_LIMIT > 12 | |
571 nil_t, nil_t, nil_t, | |
572 #endif | |
573 #endif | |
574 #endif | |
575 #endif | |
576 nil_t // Unused | |
577 > | |
578 : public tuple_base<tuple<A> > { | |
579 | |
580 BOOST_STATIC_CONSTANT(int, length = 1); | |
581 typedef A a_type; | |
582 | |
583 tuple() {} | |
584 | |
585 tuple( | |
586 typename call_traits<A>::param_type a_ | |
587 ): a(a_) {} | |
588 | |
589 template <typename TupleT> | |
590 tuple(TupleT const& init) | |
591 : a(init[tuple_index<0>()]) | |
592 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
593 | |
594 A a; | |
595 }; | |
596 | |
597 /////////////////////////////////////////////////////////////////////////////// | |
598 // | |
599 // tuple <2 member> class | |
600 // | |
601 /////////////////////////////////////////////////////////////////////////////// | |
602 template <typename A, typename B> | |
603 struct tuple<A, B, nil_t, | |
604 #if PHOENIX_LIMIT > 3 | |
605 nil_t, nil_t, nil_t, | |
606 #if PHOENIX_LIMIT > 6 | |
607 nil_t, nil_t, nil_t, | |
608 #if PHOENIX_LIMIT > 9 | |
609 nil_t, nil_t, nil_t, | |
610 #if PHOENIX_LIMIT > 12 | |
611 nil_t, nil_t, nil_t, | |
612 #endif | |
613 #endif | |
614 #endif | |
615 #endif | |
616 nil_t // Unused | |
617 > | |
618 : public tuple_base<tuple<A, B> > { | |
619 | |
620 BOOST_STATIC_CONSTANT(int, length = 2); | |
621 typedef A a_type; typedef B b_type; | |
622 | |
623 tuple() {} | |
624 | |
625 tuple( | |
626 typename call_traits<A>::param_type a_, | |
627 typename call_traits<B>::param_type b_ | |
628 ): a(a_), b(b_) {} | |
629 | |
630 template <typename TupleT> | |
631 tuple(TupleT const& init) | |
632 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]) | |
633 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
634 | |
635 A a; B b; | |
636 }; | |
637 | |
638 /////////////////////////////////////////////////////////////////////////////// | |
639 // | |
640 // tuple <3 member> class | |
641 // | |
642 /////////////////////////////////////////////////////////////////////////////// | |
643 template <typename A, typename B, typename C> | |
644 struct tuple<A, B, C, | |
645 #if PHOENIX_LIMIT > 3 | |
646 nil_t, nil_t, nil_t, | |
647 #if PHOENIX_LIMIT > 6 | |
648 nil_t, nil_t, nil_t, | |
649 #if PHOENIX_LIMIT > 9 | |
650 nil_t, nil_t, nil_t, | |
651 #if PHOENIX_LIMIT > 12 | |
652 nil_t, nil_t, nil_t, | |
653 #endif | |
654 #endif | |
655 #endif | |
656 #endif | |
657 nil_t // Unused | |
658 > | |
659 : public tuple_base<tuple<A, B, C> > { | |
660 | |
661 BOOST_STATIC_CONSTANT(int, length = 3); | |
662 typedef A a_type; typedef B b_type; | |
663 typedef C c_type; | |
664 | |
665 tuple() {} | |
666 | |
667 tuple( | |
668 typename call_traits<A>::param_type a_, | |
669 typename call_traits<B>::param_type b_, | |
670 typename call_traits<C>::param_type c_ | |
671 ): a(a_), b(b_), c(c_) {} | |
672 | |
673 template <typename TupleT> | |
674 tuple(TupleT const& init) | |
675 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
676 c(init[tuple_index<2>()]) | |
677 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
678 | |
679 A a; B b; C c; | |
680 }; | |
681 | |
682 #if PHOENIX_LIMIT > 3 | |
683 /////////////////////////////////////////////////////////////////////////////// | |
684 // | |
685 // tuple <4 member> class | |
686 // | |
687 /////////////////////////////////////////////////////////////////////////////// | |
688 template <typename A, typename B, typename C, typename D> | |
689 struct tuple<A, B, C, D, nil_t, nil_t, | |
690 #if PHOENIX_LIMIT > 6 | |
691 nil_t, nil_t, nil_t, | |
692 #if PHOENIX_LIMIT > 9 | |
693 nil_t, nil_t, nil_t, | |
694 #if PHOENIX_LIMIT > 12 | |
695 nil_t, nil_t, nil_t, | |
696 #endif | |
697 #endif | |
698 #endif | |
699 nil_t // Unused | |
700 > | |
701 : public tuple_base<tuple<A, B, C, D> > { | |
702 | |
703 BOOST_STATIC_CONSTANT(int, length = 4); | |
704 typedef A a_type; typedef B b_type; | |
705 typedef C c_type; typedef D d_type; | |
706 | |
707 tuple() {} | |
708 | |
709 tuple( | |
710 typename call_traits<A>::param_type a_, | |
711 typename call_traits<B>::param_type b_, | |
712 typename call_traits<C>::param_type c_, | |
713 typename call_traits<D>::param_type d_ | |
714 ): a(a_), b(b_), c(c_), d(d_) {} | |
715 | |
716 template <typename TupleT> | |
717 tuple(TupleT const& init) | |
718 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
719 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]) | |
720 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
721 | |
722 A a; B b; C c; D d; | |
723 }; | |
724 | |
725 /////////////////////////////////////////////////////////////////////////////// | |
726 // | |
727 // tuple <5 member> class | |
728 // | |
729 /////////////////////////////////////////////////////////////////////////////// | |
730 template <typename A, typename B, typename C, typename D, typename E> | |
731 struct tuple<A, B, C, D, E, nil_t, | |
732 #if PHOENIX_LIMIT > 6 | |
733 nil_t, nil_t, nil_t, | |
734 #if PHOENIX_LIMIT > 9 | |
735 nil_t, nil_t, nil_t, | |
736 #if PHOENIX_LIMIT > 12 | |
737 nil_t, nil_t, nil_t, | |
738 #endif | |
739 #endif | |
740 #endif | |
741 nil_t // Unused | |
742 > | |
743 : public tuple_base<tuple<A, B, C, D, E> > { | |
744 | |
745 BOOST_STATIC_CONSTANT(int, length = 5); | |
746 typedef A a_type; typedef B b_type; | |
747 typedef C c_type; typedef D d_type; | |
748 typedef E e_type; | |
749 | |
750 tuple() {} | |
751 | |
752 tuple( | |
753 typename call_traits<A>::param_type a_, | |
754 typename call_traits<B>::param_type b_, | |
755 typename call_traits<C>::param_type c_, | |
756 typename call_traits<D>::param_type d_, | |
757 typename call_traits<E>::param_type e_ | |
758 ): a(a_), b(b_), c(c_), d(d_), e(e_) {} | |
759 | |
760 template <typename TupleT> | |
761 tuple(TupleT const& init) | |
762 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
763 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), | |
764 e(init[tuple_index<4>()]) | |
765 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
766 | |
767 A a; B b; C c; D d; E e; | |
768 }; | |
769 | |
770 /////////////////////////////////////////////////////////////////////////////// | |
771 // | |
772 // tuple <6 member> class | |
773 // | |
774 /////////////////////////////////////////////////////////////////////////////// | |
775 template < | |
776 typename A, typename B, typename C, typename D, typename E, | |
777 typename F> | |
778 struct tuple<A, B, C, D, E, F, | |
779 #if PHOENIX_LIMIT > 6 | |
780 nil_t, nil_t, nil_t, | |
781 #if PHOENIX_LIMIT > 9 | |
782 nil_t, nil_t, nil_t, | |
783 #if PHOENIX_LIMIT > 12 | |
784 nil_t, nil_t, nil_t, | |
785 #endif | |
786 #endif | |
787 #endif | |
788 nil_t // Unused | |
789 > | |
790 : public tuple_base<tuple<A, B, C, D, E, F> > { | |
791 | |
792 BOOST_STATIC_CONSTANT(int, length = 6); | |
793 typedef A a_type; typedef B b_type; | |
794 typedef C c_type; typedef D d_type; | |
795 typedef E e_type; typedef F f_type; | |
796 | |
797 tuple() {} | |
798 | |
799 tuple( | |
800 typename call_traits<A>::param_type a_, | |
801 typename call_traits<B>::param_type b_, | |
802 typename call_traits<C>::param_type c_, | |
803 typename call_traits<D>::param_type d_, | |
804 typename call_traits<E>::param_type e_, | |
805 typename call_traits<F>::param_type f_ | |
806 ): a(a_), b(b_), c(c_), d(d_), e(e_), | |
807 f(f_) {} | |
808 | |
809 template <typename TupleT> | |
810 tuple(TupleT const& init) | |
811 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
812 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), | |
813 e(init[tuple_index<4>()]), f(init[tuple_index<5>()]) | |
814 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
815 | |
816 A a; B b; C c; D d; E e; | |
817 F f; | |
818 }; | |
819 | |
820 #if PHOENIX_LIMIT > 6 | |
821 /////////////////////////////////////////////////////////////////////////////// | |
822 // | |
823 // tuple <7 member> class | |
824 // | |
825 /////////////////////////////////////////////////////////////////////////////// | |
826 template < | |
827 typename A, typename B, typename C, typename D, typename E, | |
828 typename F, typename G> | |
829 struct tuple<A, B, C, D, E, F, G, nil_t, nil_t, | |
830 #if PHOENIX_LIMIT > 9 | |
831 nil_t, nil_t, nil_t, | |
832 #if PHOENIX_LIMIT > 12 | |
833 nil_t, nil_t, nil_t, | |
834 #endif | |
835 #endif | |
836 nil_t // Unused | |
837 > | |
838 : public tuple_base<tuple<A, B, C, D, E, F, G> > { | |
839 | |
840 BOOST_STATIC_CONSTANT(int, length = 7); | |
841 typedef A a_type; typedef B b_type; | |
842 typedef C c_type; typedef D d_type; | |
843 typedef E e_type; typedef F f_type; | |
844 typedef G g_type; | |
845 | |
846 tuple() {} | |
847 | |
848 tuple( | |
849 typename call_traits<A>::param_type a_, | |
850 typename call_traits<B>::param_type b_, | |
851 typename call_traits<C>::param_type c_, | |
852 typename call_traits<D>::param_type d_, | |
853 typename call_traits<E>::param_type e_, | |
854 typename call_traits<F>::param_type f_, | |
855 typename call_traits<G>::param_type g_ | |
856 ): a(a_), b(b_), c(c_), d(d_), e(e_), | |
857 f(f_), g(g_) {} | |
858 | |
859 template <typename TupleT> | |
860 tuple(TupleT const& init) | |
861 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
862 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), | |
863 e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), | |
864 g(init[tuple_index<6>()]) | |
865 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
866 | |
867 A a; B b; C c; D d; E e; | |
868 F f; G g; | |
869 }; | |
870 | |
871 /////////////////////////////////////////////////////////////////////////////// | |
872 // | |
873 // tuple <8 member> class | |
874 // | |
875 /////////////////////////////////////////////////////////////////////////////// | |
876 template < | |
877 typename A, typename B, typename C, typename D, typename E, | |
878 typename F, typename G, typename H> | |
879 struct tuple<A, B, C, D, E, F, G, H, nil_t, | |
880 #if PHOENIX_LIMIT > 9 | |
881 nil_t, nil_t, nil_t, | |
882 #if PHOENIX_LIMIT > 12 | |
883 nil_t, nil_t, nil_t, | |
884 #endif | |
885 #endif | |
886 nil_t // Unused | |
887 > | |
888 : public tuple_base<tuple<A, B, C, D, E, F, G, H> > { | |
889 | |
890 BOOST_STATIC_CONSTANT(int, length = 8); | |
891 typedef A a_type; typedef B b_type; | |
892 typedef C c_type; typedef D d_type; | |
893 typedef E e_type; typedef F f_type; | |
894 typedef G g_type; typedef H h_type; | |
895 | |
896 tuple() {} | |
897 | |
898 tuple( | |
899 typename call_traits<A>::param_type a_, | |
900 typename call_traits<B>::param_type b_, | |
901 typename call_traits<C>::param_type c_, | |
902 typename call_traits<D>::param_type d_, | |
903 typename call_traits<E>::param_type e_, | |
904 typename call_traits<F>::param_type f_, | |
905 typename call_traits<G>::param_type g_, | |
906 typename call_traits<H>::param_type h_ | |
907 ): a(a_), b(b_), c(c_), d(d_), e(e_), | |
908 f(f_), g(g_), h(h_) {} | |
909 | |
910 template <typename TupleT> | |
911 tuple(TupleT const& init) | |
912 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
913 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), | |
914 e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), | |
915 g(init[tuple_index<6>()]), h(init[tuple_index<7>()]) | |
916 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
917 | |
918 A a; B b; C c; D d; E e; | |
919 F f; G g; H h; | |
920 }; | |
921 | |
922 /////////////////////////////////////////////////////////////////////////////// | |
923 // | |
924 // tuple <9 member> class | |
925 // | |
926 /////////////////////////////////////////////////////////////////////////////// | |
927 template < | |
928 typename A, typename B, typename C, typename D, typename E, | |
929 typename F, typename G, typename H, typename I> | |
930 struct tuple<A, B, C, D, E, F, G, H, I, | |
931 #if PHOENIX_LIMIT > 9 | |
932 nil_t, nil_t, nil_t, | |
933 #if PHOENIX_LIMIT > 12 | |
934 nil_t, nil_t, nil_t, | |
935 #endif | |
936 #endif | |
937 nil_t // Unused | |
938 > | |
939 : public tuple_base<tuple<A, B, C, D, E, F, G, H, I> > { | |
940 | |
941 BOOST_STATIC_CONSTANT(int, length = 9); | |
942 typedef A a_type; typedef B b_type; | |
943 typedef C c_type; typedef D d_type; | |
944 typedef E e_type; typedef F f_type; | |
945 typedef G g_type; typedef H h_type; | |
946 typedef I i_type; | |
947 | |
948 tuple() {} | |
949 | |
950 tuple( | |
951 typename call_traits<A>::param_type a_, | |
952 typename call_traits<B>::param_type b_, | |
953 typename call_traits<C>::param_type c_, | |
954 typename call_traits<D>::param_type d_, | |
955 typename call_traits<E>::param_type e_, | |
956 typename call_traits<F>::param_type f_, | |
957 typename call_traits<G>::param_type g_, | |
958 typename call_traits<H>::param_type h_, | |
959 typename call_traits<I>::param_type i_ | |
960 ): a(a_), b(b_), c(c_), d(d_), e(e_), | |
961 f(f_), g(g_), h(h_), i(i_) {} | |
962 | |
963 template <typename TupleT> | |
964 tuple(TupleT const& init) | |
965 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
966 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), | |
967 e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), | |
968 g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), | |
969 i(init[tuple_index<8>()]) | |
970 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
971 | |
972 A a; B b; C c; D d; E e; | |
973 F f; G g; H h; I i; | |
974 }; | |
975 | |
976 #if PHOENIX_LIMIT > 9 | |
977 /////////////////////////////////////////////////////////////////////////////// | |
978 // | |
979 // tuple <10 member> class | |
980 // | |
981 /////////////////////////////////////////////////////////////////////////////// | |
982 template < | |
983 typename A, typename B, typename C, typename D, typename E, | |
984 typename F, typename G, typename H, typename I, typename J> | |
985 struct tuple<A, B, C, D, E, F, G, H, I, J, nil_t, nil_t, | |
986 #if PHOENIX_LIMIT > 12 | |
987 nil_t, nil_t, nil_t, | |
988 #endif | |
989 nil_t // Unused | |
990 > | |
991 : public tuple_base<tuple<A, B, C, D, E, F, G, H, I, J> > { | |
992 | |
993 BOOST_STATIC_CONSTANT(int, length = 10); | |
994 typedef A a_type; typedef B b_type; | |
995 typedef C c_type; typedef D d_type; | |
996 typedef E e_type; typedef F f_type; | |
997 typedef G g_type; typedef H h_type; | |
998 typedef I i_type; typedef J j_type; | |
999 | |
1000 tuple() {} | |
1001 | |
1002 tuple( | |
1003 typename call_traits<A>::param_type a_, | |
1004 typename call_traits<B>::param_type b_, | |
1005 typename call_traits<C>::param_type c_, | |
1006 typename call_traits<D>::param_type d_, | |
1007 typename call_traits<E>::param_type e_, | |
1008 typename call_traits<F>::param_type f_, | |
1009 typename call_traits<G>::param_type g_, | |
1010 typename call_traits<H>::param_type h_, | |
1011 typename call_traits<I>::param_type i_, | |
1012 typename call_traits<J>::param_type j_ | |
1013 ): a(a_), b(b_), c(c_), d(d_), e(e_), | |
1014 f(f_), g(g_), h(h_), i(i_), j(j_) {} | |
1015 | |
1016 template <typename TupleT> | |
1017 tuple(TupleT const& init) | |
1018 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
1019 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), | |
1020 e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), | |
1021 g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), | |
1022 i(init[tuple_index<8>()]), j(init[tuple_index<9>()]) | |
1023 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
1024 | |
1025 A a; B b; C c; D d; E e; | |
1026 F f; G g; H h; I i; J j; | |
1027 }; | |
1028 | |
1029 /////////////////////////////////////////////////////////////////////////////// | |
1030 // | |
1031 // tuple <11 member> class | |
1032 // | |
1033 /////////////////////////////////////////////////////////////////////////////// | |
1034 template < | |
1035 typename A, typename B, typename C, typename D, typename E, | |
1036 typename F, typename G, typename H, typename I, typename J, | |
1037 typename K> | |
1038 struct tuple<A, B, C, D, E, F, G, H, I, J, K, nil_t, | |
1039 #if PHOENIX_LIMIT > 12 | |
1040 nil_t, nil_t, nil_t, | |
1041 #endif | |
1042 nil_t // Unused | |
1043 > | |
1044 : public tuple_base<tuple<A, B, C, D, E, F, G, H, I, J, K> > { | |
1045 | |
1046 BOOST_STATIC_CONSTANT(int, length = 11); | |
1047 typedef A a_type; typedef B b_type; | |
1048 typedef C c_type; typedef D d_type; | |
1049 typedef E e_type; typedef F f_type; | |
1050 typedef G g_type; typedef H h_type; | |
1051 typedef I i_type; typedef J j_type; | |
1052 typedef K k_type; | |
1053 | |
1054 tuple() {} | |
1055 | |
1056 tuple( | |
1057 typename call_traits<A>::param_type a_, | |
1058 typename call_traits<B>::param_type b_, | |
1059 typename call_traits<C>::param_type c_, | |
1060 typename call_traits<D>::param_type d_, | |
1061 typename call_traits<E>::param_type e_, | |
1062 typename call_traits<F>::param_type f_, | |
1063 typename call_traits<G>::param_type g_, | |
1064 typename call_traits<H>::param_type h_, | |
1065 typename call_traits<I>::param_type i_, | |
1066 typename call_traits<J>::param_type j_, | |
1067 typename call_traits<K>::param_type k_ | |
1068 ): a(a_), b(b_), c(c_), d(d_), e(e_), | |
1069 f(f_), g(g_), h(h_), i(i_), j(j_), | |
1070 k(k_) {} | |
1071 | |
1072 template <typename TupleT> | |
1073 tuple(TupleT const& init) | |
1074 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
1075 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), | |
1076 e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), | |
1077 g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), | |
1078 i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), | |
1079 k(init[tuple_index<10>()]) | |
1080 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
1081 | |
1082 A a; B b; C c; D d; E e; | |
1083 F f; G g; H h; I i; J j; | |
1084 K k; | |
1085 }; | |
1086 | |
1087 /////////////////////////////////////////////////////////////////////////////// | |
1088 // | |
1089 // tuple <12 member> class | |
1090 // | |
1091 /////////////////////////////////////////////////////////////////////////////// | |
1092 template < | |
1093 typename A, typename B, typename C, typename D, typename E, | |
1094 typename F, typename G, typename H, typename I, typename J, | |
1095 typename K, typename L> | |
1096 struct tuple<A, B, C, D, E, F, G, H, I, J, K, L, | |
1097 #if PHOENIX_LIMIT > 12 | |
1098 nil_t, nil_t, nil_t, | |
1099 #endif | |
1100 nil_t // Unused | |
1101 > | |
1102 : public tuple_base<tuple<A, B, C, D, E, F, G, H, I, J, K, L> > { | |
1103 | |
1104 BOOST_STATIC_CONSTANT(int, length = 12); | |
1105 typedef A a_type; typedef B b_type; | |
1106 typedef C c_type; typedef D d_type; | |
1107 typedef E e_type; typedef F f_type; | |
1108 typedef G g_type; typedef H h_type; | |
1109 typedef I i_type; typedef J j_type; | |
1110 typedef K k_type; typedef L l_type; | |
1111 | |
1112 tuple() {} | |
1113 | |
1114 tuple( | |
1115 typename call_traits<A>::param_type a_, | |
1116 typename call_traits<B>::param_type b_, | |
1117 typename call_traits<C>::param_type c_, | |
1118 typename call_traits<D>::param_type d_, | |
1119 typename call_traits<E>::param_type e_, | |
1120 typename call_traits<F>::param_type f_, | |
1121 typename call_traits<G>::param_type g_, | |
1122 typename call_traits<H>::param_type h_, | |
1123 typename call_traits<I>::param_type i_, | |
1124 typename call_traits<J>::param_type j_, | |
1125 typename call_traits<K>::param_type k_, | |
1126 typename call_traits<L>::param_type l_ | |
1127 ): a(a_), b(b_), c(c_), d(d_), e(e_), | |
1128 f(f_), g(g_), h(h_), i(i_), j(j_), | |
1129 k(k_), l(l_) {} | |
1130 | |
1131 template <typename TupleT> | |
1132 tuple(TupleT const& init) | |
1133 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
1134 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), | |
1135 e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), | |
1136 g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), | |
1137 i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), | |
1138 k(init[tuple_index<10>()]), l(init[tuple_index<11>()]) | |
1139 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
1140 | |
1141 A a; B b; C c; D d; E e; | |
1142 F f; G g; H h; I i; J j; | |
1143 K k; L l; | |
1144 }; | |
1145 | |
1146 #if PHOENIX_LIMIT > 12 | |
1147 /////////////////////////////////////////////////////////////////////////////// | |
1148 // | |
1149 // tuple <13 member> class | |
1150 // | |
1151 /////////////////////////////////////////////////////////////////////////////// | |
1152 template < | |
1153 typename A, typename B, typename C, typename D, typename E, | |
1154 typename F, typename G, typename H, typename I, typename J, | |
1155 typename K, typename L, typename M> | |
1156 struct tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, nil_t, nil_t, nil_t> | |
1157 : public tuple_base< | |
1158 tuple<A, B, C, D, E, F, G, H, I, J, K, L, M> > { | |
1159 | |
1160 BOOST_STATIC_CONSTANT(int, length = 13); | |
1161 typedef A a_type; typedef B b_type; | |
1162 typedef C c_type; typedef D d_type; | |
1163 typedef E e_type; typedef F f_type; | |
1164 typedef G g_type; typedef H h_type; | |
1165 typedef I i_type; typedef J j_type; | |
1166 typedef K k_type; typedef L l_type; | |
1167 typedef M m_type; | |
1168 | |
1169 tuple() {} | |
1170 | |
1171 tuple( | |
1172 typename call_traits<A>::param_type a_, | |
1173 typename call_traits<B>::param_type b_, | |
1174 typename call_traits<C>::param_type c_, | |
1175 typename call_traits<D>::param_type d_, | |
1176 typename call_traits<E>::param_type e_, | |
1177 typename call_traits<F>::param_type f_, | |
1178 typename call_traits<G>::param_type g_, | |
1179 typename call_traits<H>::param_type h_, | |
1180 typename call_traits<I>::param_type i_, | |
1181 typename call_traits<J>::param_type j_, | |
1182 typename call_traits<K>::param_type k_, | |
1183 typename call_traits<L>::param_type l_, | |
1184 typename call_traits<M>::param_type m_ | |
1185 ): a(a_), b(b_), c(c_), d(d_), e(e_), | |
1186 f(f_), g(g_), h(h_), i(i_), j(j_), | |
1187 k(k_), l(l_), m(m_) {} | |
1188 | |
1189 template <typename TupleT> | |
1190 tuple(TupleT const& init) | |
1191 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
1192 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), | |
1193 e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), | |
1194 g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), | |
1195 i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), | |
1196 k(init[tuple_index<10>()]), l(init[tuple_index<11>()]), | |
1197 m(init[tuple_index<12>()]) | |
1198 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
1199 | |
1200 A a; B b; C c; D d; E e; | |
1201 F f; G g; H h; I i; J j; | |
1202 K k; L l; M m; | |
1203 }; | |
1204 | |
1205 /////////////////////////////////////////////////////////////////////////////// | |
1206 // | |
1207 // tuple <14 member> class | |
1208 // | |
1209 /////////////////////////////////////////////////////////////////////////////// | |
1210 template < | |
1211 typename A, typename B, typename C, typename D, typename E, | |
1212 typename F, typename G, typename H, typename I, typename J, | |
1213 typename K, typename L, typename M, typename N> | |
1214 struct tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N, nil_t, nil_t> | |
1215 : public tuple_base< | |
1216 tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N> > { | |
1217 | |
1218 BOOST_STATIC_CONSTANT(int, length = 14); | |
1219 typedef A a_type; typedef B b_type; | |
1220 typedef C c_type; typedef D d_type; | |
1221 typedef E e_type; typedef F f_type; | |
1222 typedef G g_type; typedef H h_type; | |
1223 typedef I i_type; typedef J j_type; | |
1224 typedef K k_type; typedef L l_type; | |
1225 typedef M m_type; typedef N n_type; | |
1226 | |
1227 tuple() {} | |
1228 | |
1229 tuple( | |
1230 typename call_traits<A>::param_type a_, | |
1231 typename call_traits<B>::param_type b_, | |
1232 typename call_traits<C>::param_type c_, | |
1233 typename call_traits<D>::param_type d_, | |
1234 typename call_traits<E>::param_type e_, | |
1235 typename call_traits<F>::param_type f_, | |
1236 typename call_traits<G>::param_type g_, | |
1237 typename call_traits<H>::param_type h_, | |
1238 typename call_traits<I>::param_type i_, | |
1239 typename call_traits<J>::param_type j_, | |
1240 typename call_traits<K>::param_type k_, | |
1241 typename call_traits<L>::param_type l_, | |
1242 typename call_traits<M>::param_type m_, | |
1243 typename call_traits<N>::param_type n_ | |
1244 ): a(a_), b(b_), c(c_), d(d_), e(e_), | |
1245 f(f_), g(g_), h(h_), i(i_), j(j_), | |
1246 k(k_), l(l_), m(m_), n(n_) {} | |
1247 | |
1248 template <typename TupleT> | |
1249 tuple(TupleT const& init) | |
1250 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
1251 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), | |
1252 e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), | |
1253 g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), | |
1254 i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), | |
1255 k(init[tuple_index<10>()]), l(init[tuple_index<11>()]), | |
1256 m(init[tuple_index<12>()]), n(init[tuple_index<13>()]) | |
1257 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
1258 | |
1259 A a; B b; C c; D d; E e; | |
1260 F f; G g; H h; I i; J j; | |
1261 K k; L l; M m; N n; | |
1262 }; | |
1263 | |
1264 /////////////////////////////////////////////////////////////////////////////// | |
1265 // | |
1266 // tuple <15 member> class | |
1267 // | |
1268 /////////////////////////////////////////////////////////////////////////////// | |
1269 template < | |
1270 typename A, typename B, typename C, typename D, typename E, | |
1271 typename F, typename G, typename H, typename I, typename J, | |
1272 typename K, typename L, typename M, typename N, typename O> | |
1273 struct tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, nil_t> | |
1274 : public tuple_base< | |
1275 tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> > { | |
1276 | |
1277 BOOST_STATIC_CONSTANT(int, length = 15); | |
1278 typedef A a_type; typedef B b_type; | |
1279 typedef C c_type; typedef D d_type; | |
1280 typedef E e_type; typedef F f_type; | |
1281 typedef G g_type; typedef H h_type; | |
1282 typedef I i_type; typedef J j_type; | |
1283 typedef K k_type; typedef L l_type; | |
1284 typedef M m_type; typedef N n_type; | |
1285 typedef O o_type; | |
1286 | |
1287 tuple() {} | |
1288 | |
1289 tuple( | |
1290 typename call_traits<A>::param_type a_, | |
1291 typename call_traits<B>::param_type b_, | |
1292 typename call_traits<C>::param_type c_, | |
1293 typename call_traits<D>::param_type d_, | |
1294 typename call_traits<E>::param_type e_, | |
1295 typename call_traits<F>::param_type f_, | |
1296 typename call_traits<G>::param_type g_, | |
1297 typename call_traits<H>::param_type h_, | |
1298 typename call_traits<I>::param_type i_, | |
1299 typename call_traits<J>::param_type j_, | |
1300 typename call_traits<K>::param_type k_, | |
1301 typename call_traits<L>::param_type l_, | |
1302 typename call_traits<M>::param_type m_, | |
1303 typename call_traits<N>::param_type n_, | |
1304 typename call_traits<O>::param_type o_ | |
1305 ): a(a_), b(b_), c(c_), d(d_), e(e_), | |
1306 f(f_), g(g_), h(h_), i(i_), j(j_), | |
1307 k(k_), l(l_), m(m_), n(n_), o(o_) {} | |
1308 | |
1309 template <typename TupleT> | |
1310 tuple(TupleT const& init) | |
1311 : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), | |
1312 c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), | |
1313 e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), | |
1314 g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), | |
1315 i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), | |
1316 k(init[tuple_index<10>()]), l(init[tuple_index<11>()]), | |
1317 m(init[tuple_index<12>()]), n(init[tuple_index<13>()]), | |
1318 o(init[tuple_index<14>()]) | |
1319 { BOOST_STATIC_ASSERT(TupleT::length == length); } | |
1320 | |
1321 A a; B b; C c; D d; E e; | |
1322 F f; G g; H h; I i; J j; | |
1323 K k; L l; M m; N n; O o; | |
1324 }; | |
1325 | |
1326 #endif | |
1327 #endif | |
1328 #endif | |
1329 #endif | |
1330 | |
1331 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) | |
1332 #pragma warning(pop) | |
1333 #endif | |
1334 | |
1335 /////////////////////////////////////////////////////////////////////////////// | |
1336 } // namespace phoenix | |
1337 | |
1338 #endif |