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