1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
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_VECTOR_07072005_1244)
8 #define FUSION_VECTOR_07072005_1244
10 #include <boost/preprocessor/iterate.hpp>
11 #include <boost/preprocessor/repetition/enum_params.hpp>
12 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
13 #include <boost/fusion/support/config.hpp>
14 #include <boost/fusion/support/void.hpp>
15 #include <boost/fusion/support/detail/enabler.hpp>
16 #include <boost/fusion/support/is_sequence.hpp>
17 #include <boost/fusion/container/vector/vector_fwd.hpp>
18 #include <boost/fusion/container/vector/detail/cpp03/vector_n_chooser.hpp>
19 #include <boost/fusion/sequence/intrinsic/begin.hpp>
20 #include <boost/mpl/at.hpp>
21 #include <boost/mpl/bool.hpp>
22 #include <boost/type_traits/add_reference.hpp>
23 #include <boost/type_traits/add_const.hpp>
24 #include <boost/type_traits/is_base_of.hpp>
25 #include <boost/detail/workaround.hpp>
26 #include <boost/core/enable_if.hpp>
30 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1600)
32 #define BOOST_FUSION_VECTOR_COPY_INIT() \
33 ctor_helper(rhs, is_base_of<vector, Sequence>()) \
35 #define BOOST_FUSION_VECTOR_CTOR_HELPER() \
36 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
37 static vector_n const& \
38 ctor_helper(vector const& rhs, mpl::true_) \
43 template <typename T> \
44 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
46 ctor_helper(T const& rhs, mpl::false_) \
53 #define BOOST_FUSION_VECTOR_COPY_INIT() \
56 #define BOOST_FUSION_VECTOR_CTOR_HELPER()
60 #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
61 #include <boost/fusion/container/vector/detail/cpp03/preprocessed/vector.hpp>
63 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
64 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/vvector" FUSION_MAX_VECTOR_SIZE_STR ".hpp")
67 /*=============================================================================
68 Copyright (c) 2001-2011 Joel de Guzman
70 Distributed under the Boost Software License, Version 1.0. (See accompanying
71 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
73 This is an auto-generated file. Do not edit!
74 ==============================================================================*/
76 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
77 #pragma wave option(preserve: 1)
80 namespace boost { namespace fusion
83 struct fusion_sequence_tag;
85 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename T)>
87 : sequence_base<vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)> >
91 typedef typename detail::vector_n_chooser<
92 BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>::type
95 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename U)>
100 typedef typename vector_n::types types;
101 typedef typename vector_n::fusion_tag fusion_tag;
102 typedef typename vector_n::tag tag;
103 typedef typename vector_n::size size;
104 typedef typename vector_n::category category;
105 typedef typename vector_n::is_view is_view;
107 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
111 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename U)>
112 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
113 vector(vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, U)> const& rhs)
116 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
117 vector(vector const& rhs)
120 template <typename Sequence>
121 BOOST_FUSION_GPU_ENABLED
122 vector(Sequence const& rhs,
123 typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
124 : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {}
126 // Expand a couple of forwarding constructors for arguments
127 // of type (T0), (T0, T1), (T0, T1, T2) etc. Example:
130 // typename detail::call_param<T0>::type arg0
131 // , typename detail::call_param<T1>::type arg1)
132 // : vec(arg0, arg1) {}
133 #include <boost/fusion/container/vector/detail/cpp03/vector_forward_ctor.hpp>
135 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename U)>
136 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
138 operator=(vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, U)> const& rhs)
144 template <typename T>
145 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
147 operator=(T const& rhs)
153 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
155 operator=(vector const& rhs)
161 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
162 FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
164 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
165 (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
166 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
168 : vec(std::forward<vector_n>(rhs.vec)) {}
170 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
172 operator=(vector&& rhs)
174 vec = std::forward<vector_n>(rhs.vec);
178 template <typename T>
179 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
183 vec = BOOST_FUSION_FWD_ELEM(T, rhs);
187 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
192 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
193 typename add_reference<
194 typename mpl::at_c<types, N>::type
196 at_impl(mpl::int_<N> index)
198 return vec.at_impl(index);
202 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
203 typename add_reference<
205 typename mpl::at_c<types, N>::type
208 at_impl(mpl::int_<N> index) const
210 return vec.at_impl(index);
213 template <typename I>
214 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
215 typename add_reference<
216 typename mpl::at<types, I>::type
220 return vec.at_impl(mpl::int_<I::value>());
224 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
225 typename add_reference<
227 typename mpl::at<types, I>::type
230 at_impl(I /*index*/) const
232 return vec.at_impl(mpl::int_<I::value>());
237 BOOST_FUSION_VECTOR_CTOR_HELPER()
242 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
243 #pragma wave option(output: null)
246 #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES