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