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/fusion/container/vector/vector_fwd.hpp>
11 #include <boost/fusion/container/vector/detail/vector_n_chooser.hpp>
12 #include <boost/fusion/sequence/intrinsic/begin.hpp>
13 #include <boost/mpl/at.hpp>
14 #include <boost/mpl/bool.hpp>
15 #include <boost/type_traits/add_reference.hpp>
16 #include <boost/type_traits/add_const.hpp>
17 #include <boost/type_traits/is_base_of.hpp>
18 #include <boost/detail/workaround.hpp>
20 #if !defined(__WAVE__)
22 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1600)
24 #define BOOST_FUSION_VECTOR_COPY_INIT() \
25 ctor_helper(rhs, is_base_of<vector, Sequence>()) \
27 #define BOOST_FUSION_VECTOR_CTOR_HELPER() \
28 static vector_n const& \
29 ctor_helper(vector const& rhs, mpl::true_) \
34 template <typename T> \
36 ctor_helper(T const& rhs, mpl::false_) \
43 #define BOOST_FUSION_VECTOR_COPY_INIT() \
46 #define BOOST_FUSION_VECTOR_CTOR_HELPER()
50 #endif // !defined(__WAVE__)
52 #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
53 #include <boost/fusion/container/vector/detail/preprocessed/vector.hpp>
55 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
56 #pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vvector" FUSION_MAX_VECTOR_SIZE_STR ".hpp")
59 /*=============================================================================
60 Copyright (c) 2001-2011 Joel de Guzman
62 Distributed under the Boost Software License, Version 1.0. (See accompanying
63 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
65 This is an auto-generated file. Do not edit!
66 ==============================================================================*/
68 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
69 #pragma wave option(preserve: 1)
72 namespace boost { namespace fusion
75 struct fusion_sequence_tag;
77 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename T)>
79 : sequence_base<vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)> >
83 typedef typename detail::vector_n_chooser<
84 BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>::type
87 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename U)>
92 typedef typename vector_n::types types;
93 typedef typename vector_n::fusion_tag fusion_tag;
94 typedef typename vector_n::tag tag;
95 typedef typename vector_n::size size;
96 typedef typename vector_n::category category;
97 typedef typename vector_n::is_view is_view;
102 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename U)>
103 vector(vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, U)> const& rhs)
106 vector(vector const& rhs)
109 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
111 : vec(std::forward<vector_n>(rhs.vec)) {}
114 template <typename Sequence>
115 vector(Sequence const& rhs)
116 : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {}
118 // Expand a couple of forwarding constructors for arguments
119 // of type (T0), (T0, T1), (T0, T1, T2) etc. Example:
122 // typename detail::call_param<T0>::type _0
123 // , typename detail::call_param<T1>::type _1)
125 #include <boost/fusion/container/vector/detail/vector_forward_ctor.hpp>
127 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename U)>
129 operator=(vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, U)> const& rhs)
135 template <typename T>
137 operator=(T const& rhs)
144 operator=(vector const& rhs)
150 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
152 operator=(vector&& rhs)
154 vec = std::forward<vector_n>(rhs.vec);
158 template <typename T>
162 vec = std::forward<T>(rhs);
168 typename add_reference<
169 typename mpl::at_c<types, N>::type
171 at_impl(mpl::int_<N> index)
173 return vec.at_impl(index);
177 typename add_reference<
179 typename mpl::at_c<types, N>::type
182 at_impl(mpl::int_<N> index) const
184 return vec.at_impl(index);
187 template <typename I>
188 typename add_reference<
189 typename mpl::at<types, I>::type
193 return vec.at_impl(mpl::int_<I::value>());
197 typename add_reference<
199 typename mpl::at<types, I>::type
202 at_impl(I /*index*/) const
204 return vec.at_impl(mpl::int_<I::value>());
209 BOOST_FUSION_VECTOR_CTOR_HELPER()
214 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
215 #pragma wave option(output: null)
218 #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES