Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2001-2011 Joel de Guzman
|
Chris@16
|
3
|
Chris@16
|
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 ==============================================================================*/
|
Chris@16
|
7 #if !defined(FUSION_TUPLE_10032005_0810)
|
Chris@16
|
8 #define FUSION_TUPLE_10032005_0810
|
Chris@16
|
9
|
Chris@16
|
10 #include <boost/fusion/tuple/tuple_fwd.hpp>
|
Chris@16
|
11 #include <boost/fusion/container/vector/vector.hpp>
|
Chris@16
|
12 #include <boost/fusion/sequence/intrinsic/size.hpp>
|
Chris@16
|
13 #include <boost/fusion/sequence/intrinsic/value_at.hpp>
|
Chris@16
|
14 #include <boost/fusion/sequence/intrinsic/at.hpp>
|
Chris@16
|
15 #include <boost/fusion/sequence/comparison.hpp>
|
Chris@16
|
16 #include <boost/fusion/sequence/io.hpp>
|
Chris@16
|
17 #include <boost/utility/enable_if.hpp>
|
Chris@16
|
18 #include <boost/type_traits/is_const.hpp>
|
Chris@16
|
19 #include <boost/config/no_tr1/utility.hpp>
|
Chris@16
|
20
|
Chris@16
|
21 #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
Chris@16
|
22 #include <boost/fusion/tuple/detail/preprocessed/tuple.hpp>
|
Chris@16
|
23 #else
|
Chris@16
|
24 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
25 #pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/tuple" FUSION_MAX_VECTOR_SIZE_STR ".hpp")
|
Chris@16
|
26 #endif
|
Chris@16
|
27
|
Chris@16
|
28 /*=============================================================================
|
Chris@16
|
29 Copyright (c) 2001-2011 Joel de Guzman
|
Chris@16
|
30
|
Chris@16
|
31 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
32 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
33
|
Chris@16
|
34 This is an auto-generated file. Do not edit!
|
Chris@16
|
35 ==============================================================================*/
|
Chris@16
|
36
|
Chris@16
|
37 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
38 #pragma wave option(preserve: 1)
|
Chris@16
|
39 #endif
|
Chris@16
|
40
|
Chris@16
|
41 namespace boost { namespace fusion
|
Chris@16
|
42 {
|
Chris@16
|
43 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename T)>
|
Chris@16
|
44 struct tuple : vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>
|
Chris@16
|
45 {
|
Chris@16
|
46 typedef vector<
|
Chris@16
|
47 BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>
|
Chris@16
|
48 base_type;
|
Chris@16
|
49
|
Chris@16
|
50 tuple()
|
Chris@16
|
51 : base_type() {}
|
Chris@16
|
52
|
Chris@16
|
53 tuple(tuple const& rhs)
|
Chris@16
|
54 : base_type(rhs) {}
|
Chris@16
|
55
|
Chris@16
|
56 template <typename U1, typename U2>
|
Chris@16
|
57 tuple(std::pair<U1, U2> const& rhs)
|
Chris@16
|
58 : base_type(rhs) {}
|
Chris@16
|
59
|
Chris@16
|
60 #include <boost/fusion/tuple/detail/tuple_expand.hpp>
|
Chris@16
|
61
|
Chris@16
|
62 template <typename T>
|
Chris@16
|
63 tuple& operator=(T const& rhs)
|
Chris@16
|
64 {
|
Chris@16
|
65 base_type::operator=(rhs);
|
Chris@16
|
66 return *this;
|
Chris@16
|
67 }
|
Chris@16
|
68
|
Chris@16
|
69 tuple& operator=(tuple const& rhs)
|
Chris@16
|
70 {
|
Chris@16
|
71 base_type::operator=(rhs);
|
Chris@16
|
72 return *this;
|
Chris@16
|
73 }
|
Chris@16
|
74
|
Chris@16
|
75 template <typename U1, typename U2>
|
Chris@16
|
76 tuple& operator=(std::pair<U1, U2> const& rhs)
|
Chris@16
|
77 {
|
Chris@16
|
78 base_type::operator=(rhs);
|
Chris@16
|
79 return *this;
|
Chris@16
|
80 }
|
Chris@16
|
81 };
|
Chris@16
|
82
|
Chris@16
|
83 template <typename Tuple>
|
Chris@16
|
84 struct tuple_size : result_of::size<Tuple> {};
|
Chris@16
|
85
|
Chris@16
|
86 template <int N, typename Tuple>
|
Chris@16
|
87 struct tuple_element : result_of::value_at_c<Tuple, N> {};
|
Chris@16
|
88
|
Chris@16
|
89 template <int N, typename Tuple>
|
Chris@16
|
90 inline typename
|
Chris@16
|
91 lazy_disable_if<
|
Chris@16
|
92 is_const<Tuple>
|
Chris@16
|
93 , result_of::at_c<Tuple, N>
|
Chris@16
|
94 >::type
|
Chris@16
|
95 get(Tuple& tup)
|
Chris@16
|
96 {
|
Chris@16
|
97 return at_c<N>(tup);
|
Chris@16
|
98 }
|
Chris@16
|
99
|
Chris@16
|
100 template <int N, typename Tuple>
|
Chris@16
|
101 inline typename result_of::at_c<Tuple const, N>::type
|
Chris@16
|
102 get(Tuple const& tup)
|
Chris@16
|
103 {
|
Chris@16
|
104 return at_c<N>(tup);
|
Chris@16
|
105 }
|
Chris@16
|
106 }}
|
Chris@16
|
107
|
Chris@16
|
108 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
109 #pragma wave option(output: null)
|
Chris@16
|
110 #endif
|
Chris@16
|
111
|
Chris@16
|
112 #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
Chris@16
|
113
|
Chris@16
|
114 #endif
|