comparison DEPENDENCIES/generic/include/boost/fusion/tuple/tuple.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/ 6 ==============================================================================*/
7 #if !defined(FUSION_TUPLE_10032005_0810) 7 #if !defined(FUSION_TUPLE_10032005_0810)
8 #define FUSION_TUPLE_10032005_0810 8 #define FUSION_TUPLE_10032005_0810
9 9
10 #include <boost/fusion/support/config.hpp>
10 #include <boost/fusion/tuple/tuple_fwd.hpp> 11 #include <boost/fusion/tuple/tuple_fwd.hpp>
11 #include <boost/fusion/container/vector/vector.hpp> 12 #include <boost/fusion/container/vector/vector.hpp>
12 #include <boost/fusion/sequence/intrinsic/size.hpp> 13 #include <boost/fusion/sequence/intrinsic/size.hpp>
13 #include <boost/fusion/sequence/intrinsic/value_at.hpp> 14 #include <boost/fusion/sequence/intrinsic/value_at.hpp>
14 #include <boost/fusion/sequence/intrinsic/at.hpp> 15 #include <boost/fusion/sequence/intrinsic/at.hpp>
45 { 46 {
46 typedef vector< 47 typedef vector<
47 BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)> 48 BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>
48 base_type; 49 base_type;
49 50
50 tuple() 51 BOOST_FUSION_GPU_ENABLED tuple()
51 : base_type() {} 52 : base_type() {}
52 53
53 tuple(tuple const& rhs) 54 BOOST_FUSION_GPU_ENABLED tuple(tuple const& rhs)
54 : base_type(rhs) {} 55 : base_type(rhs) {}
55 56
56 template <typename U1, typename U2> 57 template <typename U1, typename U2>
58 BOOST_FUSION_GPU_ENABLED
57 tuple(std::pair<U1, U2> const& rhs) 59 tuple(std::pair<U1, U2> const& rhs)
58 : base_type(rhs) {} 60 : base_type(rhs) {}
59 61
60 #include <boost/fusion/tuple/detail/tuple_expand.hpp> 62 #include <boost/fusion/tuple/detail/tuple_expand.hpp>
61 63
62 template <typename T> 64 template <typename T>
65 BOOST_FUSION_GPU_ENABLED
63 tuple& operator=(T const& rhs) 66 tuple& operator=(T const& rhs)
64 { 67 {
65 base_type::operator=(rhs); 68 base_type::operator=(rhs);
66 return *this; 69 return *this;
67 } 70 }
68 71
72 BOOST_FUSION_GPU_ENABLED
69 tuple& operator=(tuple const& rhs) 73 tuple& operator=(tuple const& rhs)
70 { 74 {
71 base_type::operator=(rhs); 75 base_type::operator=(rhs);
72 return *this; 76 return *this;
73 } 77 }
74 78
75 template <typename U1, typename U2> 79 template <typename U1, typename U2>
80 BOOST_FUSION_GPU_ENABLED
76 tuple& operator=(std::pair<U1, U2> const& rhs) 81 tuple& operator=(std::pair<U1, U2> const& rhs)
77 { 82 {
78 base_type::operator=(rhs); 83 base_type::operator=(rhs);
79 return *this; 84 return *this;
80 } 85 }
85 90
86 template <int N, typename Tuple> 91 template <int N, typename Tuple>
87 struct tuple_element : result_of::value_at_c<Tuple, N> {}; 92 struct tuple_element : result_of::value_at_c<Tuple, N> {};
88 93
89 template <int N, typename Tuple> 94 template <int N, typename Tuple>
95 BOOST_FUSION_GPU_ENABLED
90 inline typename 96 inline typename
91 lazy_disable_if< 97 lazy_disable_if<
92 is_const<Tuple> 98 is_const<Tuple>
93 , result_of::at_c<Tuple, N> 99 , result_of::at_c<Tuple, N>
94 >::type 100 >::type
96 { 102 {
97 return at_c<N>(tup); 103 return at_c<N>(tup);
98 } 104 }
99 105
100 template <int N, typename Tuple> 106 template <int N, typename Tuple>
107 BOOST_FUSION_GPU_ENABLED
101 inline typename result_of::at_c<Tuple const, N>::type 108 inline typename result_of::at_c<Tuple const, N>::type
102 get(Tuple const& tup) 109 get(Tuple const& tup)
103 { 110 {
104 return at_c<N>(tup); 111 return at_c<N>(tup);
105 } 112 }
110 #endif 117 #endif
111 118
112 #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES 119 #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
113 120
114 #endif 121 #endif
122