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