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