1 /*=============================================================================
2 Copyright (c) 2005 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(FUSION_TUPLE_10032005_0810)
8 #define FUSION_TUPLE_10032005_0810
10 #include <boost/fusion/tuple/tuple_fwd.hpp>
11 #include <boost/fusion/container/vector/vector.hpp>
12 #include <boost/fusion/sequence/intrinsic/size.hpp>
13 #include <boost/fusion/sequence/intrinsic/value_at.hpp>
14 #include <boost/fusion/sequence/intrinsic/at.hpp>
15 #include <boost/fusion/sequence/comparison.hpp>
16 #include <boost/fusion/sequence/io.hpp>
17 #include <boost/utility/enable_if.hpp>
18 #include <boost/type_traits/is_const.hpp>
19 #include <boost/config/no_tr1/utility.hpp>
21 namespace boost { namespace fusion
23 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename T)>
24 struct tuple : vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>
27 BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>
33 tuple(tuple const& rhs)
36 template <typename U1, typename U2>
37 tuple(std::pair<U1, U2> const& rhs)
40 #include <boost/fusion/tuple/detail/tuple_expand.hpp>
43 tuple& operator=(T const& rhs)
45 base_type::operator=(rhs);
49 tuple& operator=(tuple const& rhs)
51 base_type::operator=(rhs);
55 template <typename U1, typename U2>
56 tuple& operator=(std::pair<U1, U2> const& rhs)
58 base_type::operator=(rhs);
63 template <typename Tuple>
64 struct tuple_size : result_of::size<Tuple> {};
66 template <int N, typename Tuple>
67 struct tuple_element : result_of::value_at_c<Tuple, N> {};
69 template <int N, typename Tuple>
73 , result_of::at_c<Tuple, N>
80 template <int N, typename Tuple>
81 inline typename result_of::at_c<Tuple const, N>::type