Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/fusion/tuple/tuple.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children | c530137014c0 |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
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/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> | |
20 | |
21 #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) | |
22 #include <boost/fusion/tuple/detail/preprocessed/tuple.hpp> | |
23 #else | |
24 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) | |
25 #pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/tuple" FUSION_MAX_VECTOR_SIZE_STR ".hpp") | |
26 #endif | |
27 | |
28 /*============================================================================= | |
29 Copyright (c) 2001-2011 Joel de Guzman | |
30 | |
31 Distributed under the Boost Software License, Version 1.0. (See accompanying | |
32 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
33 | |
34 This is an auto-generated file. Do not edit! | |
35 ==============================================================================*/ | |
36 | |
37 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) | |
38 #pragma wave option(preserve: 1) | |
39 #endif | |
40 | |
41 namespace boost { namespace fusion | |
42 { | |
43 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename T)> | |
44 struct tuple : vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)> | |
45 { | |
46 typedef vector< | |
47 BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)> | |
48 base_type; | |
49 | |
50 tuple() | |
51 : base_type() {} | |
52 | |
53 tuple(tuple const& rhs) | |
54 : base_type(rhs) {} | |
55 | |
56 template <typename U1, typename U2> | |
57 tuple(std::pair<U1, U2> const& rhs) | |
58 : base_type(rhs) {} | |
59 | |
60 #include <boost/fusion/tuple/detail/tuple_expand.hpp> | |
61 | |
62 template <typename T> | |
63 tuple& operator=(T const& rhs) | |
64 { | |
65 base_type::operator=(rhs); | |
66 return *this; | |
67 } | |
68 | |
69 tuple& operator=(tuple const& rhs) | |
70 { | |
71 base_type::operator=(rhs); | |
72 return *this; | |
73 } | |
74 | |
75 template <typename U1, typename U2> | |
76 tuple& operator=(std::pair<U1, U2> const& rhs) | |
77 { | |
78 base_type::operator=(rhs); | |
79 return *this; | |
80 } | |
81 }; | |
82 | |
83 template <typename Tuple> | |
84 struct tuple_size : result_of::size<Tuple> {}; | |
85 | |
86 template <int N, typename Tuple> | |
87 struct tuple_element : result_of::value_at_c<Tuple, N> {}; | |
88 | |
89 template <int N, typename Tuple> | |
90 inline typename | |
91 lazy_disable_if< | |
92 is_const<Tuple> | |
93 , result_of::at_c<Tuple, N> | |
94 >::type | |
95 get(Tuple& tup) | |
96 { | |
97 return at_c<N>(tup); | |
98 } | |
99 | |
100 template <int N, typename Tuple> | |
101 inline typename result_of::at_c<Tuple const, N>::type | |
102 get(Tuple const& tup) | |
103 { | |
104 return at_c<N>(tup); | |
105 } | |
106 }} | |
107 | |
108 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) | |
109 #pragma wave option(output: null) | |
110 #endif | |
111 | |
112 #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES | |
113 | |
114 #endif |