Chris@16: /*============================================================================= Chris@16: Phoenix V1.2.1 Chris@16: Copyright (c) 2001-2002 Joel de Guzman Chris@16: Chris@16: Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: ==============================================================================*/ Chris@16: #ifndef PHOENIX_TUPLES_HPP Chris@16: #define PHOENIX_TUPLES_HPP Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // Phoenix predefined maximum limit. This limit defines the maximum Chris@16: // number of elements a tuple can hold. This number defaults to 3. The Chris@16: // actual maximum is rounded up in multiples of 3. Thus, if this value Chris@16: // is 4, the actual limit is 6. The ultimate maximum limit in this Chris@16: // implementation is 15. Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: #ifndef PHOENIX_LIMIT Chris@16: #define PHOENIX_LIMIT 3 Chris@16: #endif Chris@16: Chris@16: #if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561) Chris@16: namespace phoenix { namespace borland_only Chris@16: { Chris@16: namespace ftors Chris@16: { Chris@16: // We define these dummy template functions. Borland complains when Chris@16: // a template class has the same name as a template function, Chris@16: // regardless if they are in different namespaces. Chris@16: Chris@16: template void if_(T) {} Chris@16: template void for_(T) {} Chris@16: template void while_(T) {} Chris@16: template void do_(T) {} Chris@16: } Chris@16: Chris@16: namespace tmpls Chris@16: { Chris@16: // We define these dummy template functions. Borland complains when Chris@16: // a template class has the same name as a template function, Chris@16: // regardless if they are in different namespaces. Chris@16: Chris@16: template struct if_ {}; Chris@16: template struct for_ {}; Chris@16: template struct while_ {}; Chris@16: template struct do_ {}; Chris@16: } Chris@16: Chris@16: }} // namespace phoenix::borland_only Chris@16: #endif Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) Chris@16: #pragma warning(push) Chris@16: #pragma warning(disable:4512) //assignment operator could not be generated Chris@16: #endif Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: namespace phoenix { Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple Chris@16: // Chris@16: // Tuples hold heterogeneous types up to a predefined maximum. Only Chris@16: // the most basic functionality needed is provided. Unlike other Chris@16: // recursive list-like tuple implementations, this tuple Chris@16: // implementation uses simple structs similar to std::pair with Chris@16: // specialization for 0 to N tuple elements. Chris@16: // Chris@16: // 1) Construction Chris@16: // Here are examples on how to construct tuples: Chris@16: // Chris@16: // typedef tuple t1_t; Chris@16: // typedef tuple t2_t; Chris@16: // Chris@16: // // this tuple has an int and char members Chris@16: // t1_t t1(3, 'c'); Chris@16: // Chris@16: // // this tuple has an int, std::string and double members Chris@16: // t2_t t2(3, "hello", 3.14); Chris@16: // Chris@16: // Tuples can also be constructed from other tuples. The Chris@16: // source and destination tuples need not have exactly the Chris@16: // same element types. The only requirement is that the Chris@16: // source tuple have the same number of elements as the Chris@16: // destination and that each element slot in the Chris@16: // destination can be copy constructed from the source Chris@16: // element. For example: Chris@16: // Chris@16: // tuple t3(t1); // OK. Compatible tuples Chris@16: // tuple t4(t2); // Error! Incompatible tuples Chris@16: // Chris@16: // 2) Member access Chris@16: // A member in a tuple can be accessed using the Chris@16: // tuple's [] operator by specifying the Nth Chris@16: // tuple_index. Here are some examples: Chris@16: // Chris@16: // tuple_index<0> ix0; // 0th index == 1st item Chris@16: // tuple_index<1> ix1; // 1st index == 2nd item Chris@16: // tuple_index<2> ix2; // 2nd index == 3rd item Chris@16: // Chris@16: // t1[ix0] = 33; // sets the int member of the tuple t1 Chris@16: // t2[ix2] = 6e6; // sets the double member of the tuple t2 Chris@16: // t1[ix1] = 'a'; // sets the char member of the tuple t1 Chris@16: // Chris@16: // There are some predefined names are provided in sub- Chris@16: // namespace tuple_index_names: Chris@16: // Chris@16: // tuple_index<0> _1; Chris@16: // tuple_index<1> _2; Chris@16: // ... Chris@16: // tuple_index _N; Chris@16: // Chris@16: // These indexes may be used by 'using' namespace Chris@16: // phoenix::tuple_index_names. Chris@16: // Chris@16: // Access to out of bound indexes returns a nil_t value. Chris@16: // Chris@16: // 3) Member type inquiry Chris@16: // The type of an individual member can be queried. Chris@16: // Example: Chris@16: // Chris@16: // tuple_element<1, t2_t>::type Chris@16: // Chris@16: // Refers to the type of the second member (note zero based, Chris@16: // thus 0 = 1st item, 1 = 2nd item) of the tuple. Chris@16: // Chris@16: // Aside from tuple_element::type, there are two Chris@16: // more types that tuple_element provides: rtype and Chris@16: // crtype. While 'type' is the plain underlying type, Chris@16: // 'rtype' is the reference type, or type& and 'crtype' Chris@16: // is the constant reference type or type const&. The Chris@16: // latter two are provided to make it easy for the Chris@16: // client in dealing with the possibility of reference Chris@16: // to reference when type is already a reference, which Chris@16: // is illegal in C++. Chris@16: // Chris@16: // Access to out of bound indexes returns a nil_t type. Chris@16: // Chris@16: // 4) Tuple length Chris@16: // The number of elements in a tuple can be queried. Chris@16: // Example: Chris@16: // Chris@16: // int n = t1.length; Chris@16: // Chris@16: // gets the number of elements in tuple t1. Chris@16: // Chris@16: // length is a static constant. Thus, TupleT::length Chris@16: // also works. Example: Chris@16: // Chris@16: // int n = t1_t::length; Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: struct nil_t {}; Chris@16: using boost::remove_reference; Chris@16: using boost::call_traits; Chris@16: Chris@16: ////////////////////////////////// Chris@16: namespace impl { Chris@16: Chris@16: template Chris@16: struct access { Chris@16: Chris@16: typedef const T& ctype; Chris@16: typedef T& type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct access { Chris@16: Chris@16: typedef T& ctype; Chris@16: typedef T& type; Chris@16: }; Chris@16: } Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple_element Chris@16: // Chris@16: // A query class that gets the Nth element inside a tuple. Chris@16: // Examples: Chris@16: // Chris@16: // tuple_element<1, tuple >::type // plain Chris@16: // tuple_element<1, tuple >::rtype // ref Chris@16: // tuple_element<1, tuple >::crtype // const ref Chris@16: // Chris@16: // Has type char which is the 2nd type in the tuple Chris@16: // (note zero based, thus 0 = 1st item, 1 = 2nd item). Chris@16: // Chris@16: // Given a tuple object, the static function tuple_element::get(tuple) gets the Nth element in the tuple. The Chris@16: // tuple class' tuple::operator[] uses this to get its Nth Chris@16: // element. Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct tuple_element Chris@16: { Chris@16: typedef nil_t type; Chris@16: typedef nil_t& rtype; Chris@16: typedef nil_t const& crtype; Chris@16: Chris@16: static nil_t get(TupleT const& t) { return nil_t(); } Chris@16: }; Chris@16: Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<0, TupleT> Chris@16: { Chris@16: typedef typename TupleT::a_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.a; } Chris@16: static crtype get(TupleT const& t) { return t.a; } Chris@16: }; Chris@16: Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<1, TupleT> Chris@16: { Chris@16: typedef typename TupleT::b_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.b; } Chris@16: static crtype get(TupleT const& t) { return t.b; } Chris@16: }; Chris@16: Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<2, TupleT> Chris@16: { Chris@16: typedef typename TupleT::c_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.c; } Chris@16: static crtype get(TupleT const& t) { return t.c; } Chris@16: }; Chris@16: Chris@16: #if PHOENIX_LIMIT > 3 Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<3, TupleT> Chris@16: { Chris@16: typedef typename TupleT::d_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.d; } Chris@16: static crtype get(TupleT const& t) { return t.d; } Chris@16: }; Chris@16: Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<4, TupleT> Chris@16: { Chris@16: typedef typename TupleT::e_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.e; } Chris@16: static crtype get(TupleT const& t) { return t.e; } Chris@16: }; Chris@16: Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<5, TupleT> Chris@16: { Chris@16: typedef typename TupleT::f_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.f; } Chris@16: static crtype get(TupleT const& t) { return t.f; } Chris@16: }; Chris@16: Chris@16: #if PHOENIX_LIMIT > 6 Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<6, TupleT> Chris@16: { Chris@16: typedef typename TupleT::g_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.g; } Chris@16: static crtype get(TupleT const& t) { return t.g; } Chris@16: }; Chris@16: Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<7, TupleT> Chris@16: { Chris@16: typedef typename TupleT::h_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.h; } Chris@16: static crtype get(TupleT const& t) { return t.h; } Chris@16: }; Chris@16: Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<8, TupleT> Chris@16: { Chris@16: typedef typename TupleT::i_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.i; } Chris@16: static crtype get(TupleT const& t) { return t.i; } Chris@16: }; Chris@16: Chris@16: #if PHOENIX_LIMIT > 9 Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<9, TupleT> Chris@16: { Chris@16: typedef typename TupleT::j_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.j; } Chris@16: static crtype get(TupleT const& t) { return t.j; } Chris@16: }; Chris@16: Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<10, TupleT> Chris@16: { Chris@16: typedef typename TupleT::k_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.k; } Chris@16: static crtype get(TupleT const& t) { return t.k; } Chris@16: }; Chris@16: Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<11, TupleT> Chris@16: { Chris@16: typedef typename TupleT::l_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.l; } Chris@16: static crtype get(TupleT const& t) { return t.l; } Chris@16: }; Chris@16: Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<12, TupleT> Chris@16: { Chris@16: typedef typename TupleT::m_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.m; } Chris@16: static crtype get(TupleT const& t) { return t.m; } Chris@16: }; Chris@16: Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<13, TupleT> Chris@16: { Chris@16: typedef typename TupleT::n_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.n; } Chris@16: static crtype get(TupleT const& t) { return t.n; } Chris@16: }; Chris@16: Chris@16: ////////////////////////////////// Chris@16: template Chris@16: struct tuple_element<14, TupleT> Chris@16: { Chris@16: typedef typename TupleT::o_type type; Chris@16: typedef typename impl::access::type rtype; Chris@16: typedef typename impl::access::ctype crtype; Chris@16: Chris@16: static rtype get(TupleT& t) { return t.o; } Chris@16: static crtype get(TupleT const& t) { return t.o; } Chris@16: }; Chris@16: Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple forward declaration. Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template < Chris@16: typename A = nil_t Chris@16: , typename B = nil_t Chris@16: , typename C = nil_t Chris@16: Chris@16: #if PHOENIX_LIMIT > 3 Chris@16: , typename D = nil_t Chris@16: , typename E = nil_t Chris@16: , typename F = nil_t Chris@16: Chris@16: #if PHOENIX_LIMIT > 6 Chris@16: , typename G = nil_t Chris@16: , typename H = nil_t Chris@16: , typename I = nil_t Chris@16: Chris@16: #if PHOENIX_LIMIT > 9 Chris@16: , typename J = nil_t Chris@16: , typename K = nil_t Chris@16: , typename L = nil_t Chris@16: Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: , typename M = nil_t Chris@16: , typename N = nil_t Chris@16: , typename O = nil_t Chris@16: Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: Chris@16: , typename NU = nil_t // Not used Chris@16: > Chris@16: struct tuple; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple_index Chris@16: // Chris@16: // This class wraps an integer in a type to be used for indexing Chris@16: // the Nth element in a tuple. See tuple operator[]. Some Chris@16: // predefined names are provided in sub-namespace Chris@16: // tuple_index_names. Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct tuple_index {}; Chris@16: Chris@16: ////////////////////////////////// Chris@16: namespace tuple_index_names { Chris@16: Chris@16: tuple_index<0> const _1 = tuple_index<0>(); Chris@16: tuple_index<1> const _2 = tuple_index<1>(); Chris@16: tuple_index<2> const _3 = tuple_index<2>(); Chris@16: Chris@16: #if PHOENIX_LIMIT > 3 Chris@16: tuple_index<3> const _4 = tuple_index<3>(); Chris@16: tuple_index<4> const _5 = tuple_index<4>(); Chris@16: tuple_index<5> const _6 = tuple_index<5>(); Chris@16: Chris@16: #if PHOENIX_LIMIT > 6 Chris@16: tuple_index<6> const _7 = tuple_index<6>(); Chris@16: tuple_index<7> const _8 = tuple_index<7>(); Chris@16: tuple_index<8> const _9 = tuple_index<8>(); Chris@16: Chris@16: #if PHOENIX_LIMIT > 9 Chris@16: tuple_index<9> const _10 = tuple_index<9>(); Chris@16: tuple_index<10> const _11 = tuple_index<10>(); Chris@16: tuple_index<11> const _12 = tuple_index<11>(); Chris@16: Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: tuple_index<12> const _13 = tuple_index<12>(); Chris@16: tuple_index<13> const _14 = tuple_index<13>(); Chris@16: tuple_index<14> const _15 = tuple_index<14>(); Chris@16: Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: } Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple_common class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct tuple_base { Chris@16: Chris@16: typedef nil_t a_type; Chris@16: typedef nil_t b_type; Chris@16: typedef nil_t c_type; Chris@16: Chris@16: #if PHOENIX_LIMIT > 3 Chris@16: typedef nil_t d_type; Chris@16: typedef nil_t e_type; Chris@16: typedef nil_t f_type; Chris@16: Chris@16: #if PHOENIX_LIMIT > 6 Chris@16: typedef nil_t g_type; Chris@16: typedef nil_t h_type; Chris@16: typedef nil_t i_type; Chris@16: Chris@16: #if PHOENIX_LIMIT > 9 Chris@16: typedef nil_t j_type; Chris@16: typedef nil_t k_type; Chris@16: typedef nil_t l_type; Chris@16: Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: typedef nil_t m_type; Chris@16: typedef nil_t n_type; Chris@16: typedef nil_t o_type; Chris@16: Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: Chris@16: template Chris@16: typename tuple_element::crtype Chris@16: operator[](tuple_index) const Chris@16: { Chris@16: return tuple_element Chris@16: ::get(*static_cast(this)); Chris@16: } Chris@16: Chris@16: template Chris@16: typename tuple_element::rtype Chris@16: operator[](tuple_index) Chris@16: { Chris@16: return tuple_element Chris@16: ::get(*static_cast(this)); Chris@16: } Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <0 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template <> Chris@16: struct tuple<> Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 0); Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <1 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct tuple 3 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 6 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 9 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 1); Chris@16: typedef A a_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_ Chris@16: ): a(a_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <2 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct tuple 3 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 6 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 9 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 2); Chris@16: typedef A a_type; typedef B b_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_ Chris@16: ): a(a_), b(b_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <3 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct tuple 3 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 6 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 9 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 3); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_ Chris@16: ): a(a_), b(b_), c(c_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; Chris@16: }; Chris@16: Chris@16: #if PHOENIX_LIMIT > 3 Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <4 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct tuple 6 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 9 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 4); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_ Chris@16: ): a(a_), b(b_), c(c_), d(d_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <5 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct tuple 6 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 9 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 5); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: typedef E e_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_, Chris@16: typename call_traits::param_type e_ Chris@16: ): a(a_), b(b_), c(c_), d(d_), e(e_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), Chris@16: e(init[tuple_index<4>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; E e; Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <6 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template < Chris@16: typename A, typename B, typename C, typename D, typename E, Chris@16: typename F> Chris@16: struct tuple 6 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 9 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 6); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: typedef E e_type; typedef F f_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_, Chris@16: typename call_traits::param_type e_, Chris@16: typename call_traits::param_type f_ Chris@16: ): a(a_), b(b_), c(c_), d(d_), e(e_), Chris@16: f(f_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), Chris@16: e(init[tuple_index<4>()]), f(init[tuple_index<5>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; E e; Chris@16: F f; Chris@16: }; Chris@16: Chris@16: #if PHOENIX_LIMIT > 6 Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <7 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template < Chris@16: typename A, typename B, typename C, typename D, typename E, Chris@16: typename F, typename G> Chris@16: struct tuple 9 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 7); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: typedef E e_type; typedef F f_type; Chris@16: typedef G g_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_, Chris@16: typename call_traits::param_type e_, Chris@16: typename call_traits::param_type f_, Chris@16: typename call_traits::param_type g_ Chris@16: ): a(a_), b(b_), c(c_), d(d_), e(e_), Chris@16: f(f_), g(g_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), Chris@16: e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), Chris@16: g(init[tuple_index<6>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; E e; Chris@16: F f; G g; Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <8 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template < Chris@16: typename A, typename B, typename C, typename D, typename E, Chris@16: typename F, typename G, typename H> Chris@16: struct tuple 9 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 8); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: typedef E e_type; typedef F f_type; Chris@16: typedef G g_type; typedef H h_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_, Chris@16: typename call_traits::param_type e_, Chris@16: typename call_traits::param_type f_, Chris@16: typename call_traits::param_type g_, Chris@16: typename call_traits::param_type h_ Chris@16: ): a(a_), b(b_), c(c_), d(d_), e(e_), Chris@16: f(f_), g(g_), h(h_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), Chris@16: e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), Chris@16: g(init[tuple_index<6>()]), h(init[tuple_index<7>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; E e; Chris@16: F f; G g; H h; Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <9 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template < Chris@16: typename A, typename B, typename C, typename D, typename E, Chris@16: typename F, typename G, typename H, typename I> Chris@16: struct tuple 9 Chris@16: nil_t, nil_t, nil_t, Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 9); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: typedef E e_type; typedef F f_type; Chris@16: typedef G g_type; typedef H h_type; Chris@16: typedef I i_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_, Chris@16: typename call_traits::param_type e_, Chris@16: typename call_traits::param_type f_, Chris@16: typename call_traits::param_type g_, Chris@16: typename call_traits::param_type h_, Chris@16: typename call_traits::param_type i_ Chris@16: ): a(a_), b(b_), c(c_), d(d_), e(e_), Chris@16: f(f_), g(g_), h(h_), i(i_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), Chris@16: e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), Chris@16: g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), Chris@16: i(init[tuple_index<8>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; E e; Chris@16: F f; G g; H h; I i; Chris@16: }; Chris@16: Chris@16: #if PHOENIX_LIMIT > 9 Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <10 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template < Chris@16: typename A, typename B, typename C, typename D, typename E, Chris@16: typename F, typename G, typename H, typename I, typename J> Chris@16: struct tuple 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 10); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: typedef E e_type; typedef F f_type; Chris@16: typedef G g_type; typedef H h_type; Chris@16: typedef I i_type; typedef J j_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_, Chris@16: typename call_traits::param_type e_, Chris@16: typename call_traits::param_type f_, Chris@16: typename call_traits::param_type g_, Chris@16: typename call_traits::param_type h_, Chris@16: typename call_traits::param_type i_, Chris@16: typename call_traits::param_type j_ Chris@16: ): a(a_), b(b_), c(c_), d(d_), e(e_), Chris@16: f(f_), g(g_), h(h_), i(i_), j(j_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), Chris@16: e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), Chris@16: g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), Chris@16: i(init[tuple_index<8>()]), j(init[tuple_index<9>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; E e; Chris@16: F f; G g; H h; I i; J j; Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <11 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template < Chris@16: typename A, typename B, typename C, typename D, typename E, Chris@16: typename F, typename G, typename H, typename I, typename J, Chris@16: typename K> Chris@16: struct tuple 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 11); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: typedef E e_type; typedef F f_type; Chris@16: typedef G g_type; typedef H h_type; Chris@16: typedef I i_type; typedef J j_type; Chris@16: typedef K k_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_, Chris@16: typename call_traits::param_type e_, Chris@16: typename call_traits::param_type f_, Chris@16: typename call_traits::param_type g_, Chris@16: typename call_traits::param_type h_, Chris@16: typename call_traits::param_type i_, Chris@16: typename call_traits::param_type j_, Chris@16: typename call_traits::param_type k_ Chris@16: ): a(a_), b(b_), c(c_), d(d_), e(e_), Chris@16: f(f_), g(g_), h(h_), i(i_), j(j_), Chris@16: k(k_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), Chris@16: e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), Chris@16: g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), Chris@16: i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), Chris@16: k(init[tuple_index<10>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; E e; Chris@16: F f; G g; H h; I i; J j; Chris@16: K k; Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <12 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template < Chris@16: typename A, typename B, typename C, typename D, typename E, Chris@16: typename F, typename G, typename H, typename I, typename J, Chris@16: typename K, typename L> Chris@16: struct tuple 12 Chris@16: nil_t, nil_t, nil_t, Chris@16: #endif Chris@16: nil_t // Unused Chris@16: > Chris@16: : public tuple_base > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 12); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: typedef E e_type; typedef F f_type; Chris@16: typedef G g_type; typedef H h_type; Chris@16: typedef I i_type; typedef J j_type; Chris@16: typedef K k_type; typedef L l_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_, Chris@16: typename call_traits::param_type e_, Chris@16: typename call_traits::param_type f_, Chris@16: typename call_traits::param_type g_, Chris@16: typename call_traits::param_type h_, Chris@16: typename call_traits::param_type i_, Chris@16: typename call_traits::param_type j_, Chris@16: typename call_traits::param_type k_, Chris@16: typename call_traits::param_type l_ Chris@16: ): a(a_), b(b_), c(c_), d(d_), e(e_), Chris@16: f(f_), g(g_), h(h_), i(i_), j(j_), Chris@16: k(k_), l(l_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), Chris@16: e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), Chris@16: g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), Chris@16: i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), Chris@16: k(init[tuple_index<10>()]), l(init[tuple_index<11>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; E e; Chris@16: F f; G g; H h; I i; J j; Chris@16: K k; L l; Chris@16: }; Chris@16: Chris@16: #if PHOENIX_LIMIT > 12 Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <13 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template < Chris@16: typename A, typename B, typename C, typename D, typename E, Chris@16: typename F, typename G, typename H, typename I, typename J, Chris@16: typename K, typename L, typename M> Chris@16: struct tuple Chris@16: : public tuple_base< Chris@16: tuple > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 13); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: typedef E e_type; typedef F f_type; Chris@16: typedef G g_type; typedef H h_type; Chris@16: typedef I i_type; typedef J j_type; Chris@16: typedef K k_type; typedef L l_type; Chris@16: typedef M m_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_, Chris@16: typename call_traits::param_type e_, Chris@16: typename call_traits::param_type f_, Chris@16: typename call_traits::param_type g_, Chris@16: typename call_traits::param_type h_, Chris@16: typename call_traits::param_type i_, Chris@16: typename call_traits::param_type j_, Chris@16: typename call_traits::param_type k_, Chris@16: typename call_traits::param_type l_, Chris@16: typename call_traits::param_type m_ Chris@16: ): a(a_), b(b_), c(c_), d(d_), e(e_), Chris@16: f(f_), g(g_), h(h_), i(i_), j(j_), Chris@16: k(k_), l(l_), m(m_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), Chris@16: e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), Chris@16: g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), Chris@16: i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), Chris@16: k(init[tuple_index<10>()]), l(init[tuple_index<11>()]), Chris@16: m(init[tuple_index<12>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; E e; Chris@16: F f; G g; H h; I i; J j; Chris@16: K k; L l; M m; Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <14 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template < Chris@16: typename A, typename B, typename C, typename D, typename E, Chris@16: typename F, typename G, typename H, typename I, typename J, Chris@16: typename K, typename L, typename M, typename N> Chris@16: struct tuple Chris@16: : public tuple_base< Chris@16: tuple > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 14); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: typedef E e_type; typedef F f_type; Chris@16: typedef G g_type; typedef H h_type; Chris@16: typedef I i_type; typedef J j_type; Chris@16: typedef K k_type; typedef L l_type; Chris@16: typedef M m_type; typedef N n_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_, Chris@16: typename call_traits::param_type e_, Chris@16: typename call_traits::param_type f_, Chris@16: typename call_traits::param_type g_, Chris@16: typename call_traits::param_type h_, Chris@16: typename call_traits::param_type i_, Chris@16: typename call_traits::param_type j_, Chris@16: typename call_traits::param_type k_, Chris@16: typename call_traits::param_type l_, Chris@16: typename call_traits::param_type m_, Chris@16: typename call_traits::param_type n_ Chris@16: ): a(a_), b(b_), c(c_), d(d_), e(e_), Chris@16: f(f_), g(g_), h(h_), i(i_), j(j_), Chris@16: k(k_), l(l_), m(m_), n(n_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), Chris@16: e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), Chris@16: g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), Chris@16: i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), Chris@16: k(init[tuple_index<10>()]), l(init[tuple_index<11>()]), Chris@16: m(init[tuple_index<12>()]), n(init[tuple_index<13>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; E e; Chris@16: F f; G g; H h; I i; J j; Chris@16: K k; L l; M m; N n; Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // tuple <15 member> class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: template < Chris@16: typename A, typename B, typename C, typename D, typename E, Chris@16: typename F, typename G, typename H, typename I, typename J, Chris@16: typename K, typename L, typename M, typename N, typename O> Chris@16: struct tuple Chris@16: : public tuple_base< Chris@16: tuple > { Chris@16: Chris@16: BOOST_STATIC_CONSTANT(int, length = 15); Chris@16: typedef A a_type; typedef B b_type; Chris@16: typedef C c_type; typedef D d_type; Chris@16: typedef E e_type; typedef F f_type; Chris@16: typedef G g_type; typedef H h_type; Chris@16: typedef I i_type; typedef J j_type; Chris@16: typedef K k_type; typedef L l_type; Chris@16: typedef M m_type; typedef N n_type; Chris@16: typedef O o_type; Chris@16: Chris@16: tuple() {} Chris@16: Chris@16: tuple( Chris@16: typename call_traits::param_type a_, Chris@16: typename call_traits::param_type b_, Chris@16: typename call_traits::param_type c_, Chris@16: typename call_traits::param_type d_, Chris@16: typename call_traits::param_type e_, Chris@16: typename call_traits::param_type f_, Chris@16: typename call_traits::param_type g_, Chris@16: typename call_traits::param_type h_, Chris@16: typename call_traits::param_type i_, Chris@16: typename call_traits::param_type j_, Chris@16: typename call_traits::param_type k_, Chris@16: typename call_traits::param_type l_, Chris@16: typename call_traits::param_type m_, Chris@16: typename call_traits::param_type n_, Chris@16: typename call_traits::param_type o_ Chris@16: ): a(a_), b(b_), c(c_), d(d_), e(e_), Chris@16: f(f_), g(g_), h(h_), i(i_), j(j_), Chris@16: k(k_), l(l_), m(m_), n(n_), o(o_) {} Chris@16: Chris@16: template Chris@16: tuple(TupleT const& init) Chris@16: : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), Chris@16: c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), Chris@16: e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), Chris@16: g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), Chris@16: i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), Chris@16: k(init[tuple_index<10>()]), l(init[tuple_index<11>()]), Chris@16: m(init[tuple_index<12>()]), n(init[tuple_index<13>()]), Chris@16: o(init[tuple_index<14>()]) Chris@16: { BOOST_STATIC_ASSERT(TupleT::length == length); } Chris@16: Chris@16: A a; B b; C c; D d; E e; Chris@16: F f; G g; H h; I i; J j; Chris@16: K k; L l; M m; N n; O o; Chris@16: }; Chris@16: Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: #endif Chris@16: Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) Chris@16: #pragma warning(pop) Chris@16: #endif Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: } // namespace phoenix Chris@16: Chris@16: #endif