]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/fusion/include/boost/fusion/container/deque/detail/cpp03/deque.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / fusion / include / boost / fusion / container / deque / detail / cpp03 / deque.hpp
1 /*=============================================================================
2 Copyright (c) 2005-2012 Joel de Guzman
3 Copyright (c) 2005-2006 Dan Marsden
4
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(BOOST_PP_FUSION_DEQUE_26112006_1649)
9 #define BOOST_PP_FUSION_DEQUE_26112006_1649
10
11 #if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
12 #error "C++03 only! This file should not have been included"
13 #endif
14
15 #include <boost/fusion/container/deque/detail/cpp03/limits.hpp>
16 #include <boost/fusion/container/deque/front_extended_deque.hpp>
17 #include <boost/fusion/container/deque/back_extended_deque.hpp>
18 #include <boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp>
19 #include <boost/fusion/container/deque/detail/cpp03/deque_initial_size.hpp>
20 #include <boost/fusion/support/sequence_base.hpp>
21 #include <boost/fusion/support/detail/access.hpp>
22 #include <boost/fusion/container/deque/detail/keyed_element.hpp>
23 #include <boost/preprocessor/repetition/enum_params.hpp>
24 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
25 #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
26 #include <boost/type_traits/is_convertible.hpp>
27
28 #include <boost/fusion/container/deque/deque_fwd.hpp>
29 #include <boost/fusion/container/deque/detail/value_at_impl.hpp>
30 #include <boost/fusion/container/deque/detail/at_impl.hpp>
31 #include <boost/fusion/container/deque/detail/begin_impl.hpp>
32 #include <boost/fusion/container/deque/detail/end_impl.hpp>
33 #include <boost/fusion/container/deque/detail/is_sequence_impl.hpp>
34 #include <boost/fusion/sequence/intrinsic/begin.hpp>
35 #include <boost/mpl/bool.hpp>
36
37 #include <boost/fusion/support/void.hpp>
38 #include <boost/fusion/support/detail/enabler.hpp>
39 #include <boost/utility/enable_if.hpp>
40
41 #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
42 #include <boost/fusion/container/deque/detail/cpp03/preprocessed/deque.hpp>
43 #else
44 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
45 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
46 #endif
47
48 /*=============================================================================
49 Copyright (c) 2001-2011 Joel de Guzman
50
51 Distributed under the Boost Software License, Version 1.0. (See accompanying
52 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
53
54 This is an auto-generated file. Do not edit!
55 ==============================================================================*/
56
57 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
58 #pragma wave option(preserve: 1)
59 #endif
60
61 #define FUSION_HASH #
62
63 namespace boost { namespace fusion {
64
65 struct deque_tag;
66
67 template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename T)>
68 struct deque
69 :
70 detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type,
71 sequence_base<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)> >
72 {
73 typedef deque_tag fusion_tag;
74 typedef bidirectional_traversal_tag category;
75 typedef typename detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type base;
76 typedef typename detail::deque_initial_size<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type size;
77 typedef mpl::int_<size::value> next_up;
78 typedef mpl::int_<-1> next_down;
79 typedef mpl::false_ is_view;
80
81 #include <boost/fusion/container/deque/detail/cpp03/deque_forward_ctor.hpp>
82
83 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
84 deque()
85 {}
86
87 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
88 explicit deque(typename detail::call_param<T0>::type t0)
89 : base(t0, detail::nil_keyed_element())
90 {}
91
92 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
93 explicit deque(deque const& rhs)
94 : base(rhs)
95 {}
96
97 template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
98 BOOST_FUSION_GPU_ENABLED
99 deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& seq)
100 : base(seq)
101 {}
102
103 template<typename Sequence>
104 BOOST_FUSION_GPU_ENABLED
105 deque(Sequence const& seq
106 , typename disable_if<is_convertible<Sequence, T0>, detail::enabler_>::type = detail::enabler
107 , typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
108 : base(base::from_iterator(fusion::begin(seq)))
109 {}
110
111 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
112 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
113 deque&
114 operator=(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& rhs)
115 {
116 base::operator=(rhs);
117 return *this;
118 }
119
120 template <typename T>
121 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
122 deque&
123 operator=(T const& rhs)
124 {
125 base::operator=(rhs);
126 return *this;
127 }
128
129 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
130 FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
131 #endif
132 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
133 (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
134 template <typename T0_>
135 BOOST_FUSION_GPU_ENABLED
136 explicit deque(T0_&& t0
137 , typename enable_if<is_convertible<T0_, T0>, detail::enabler_>::type = detail::enabler
138 )
139 : base(BOOST_FUSION_FWD_ELEM(T0_, t0), detail::nil_keyed_element())
140 {}
141 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
142 explicit deque(deque&& rhs)
143 : base(std::forward<deque>(rhs))
144 {}
145 template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
146 BOOST_FUSION_GPU_ENABLED
147 deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>&& seq
148 , typename disable_if<
149 is_convertible<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>, T0>
150 , detail::enabler_
151 >::type = detail::enabler)
152 : base(std::forward<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>>(seq))
153 {}
154 template <typename T>
155 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
156 deque&
157 operator=(T&& rhs)
158 {
159 base::operator=(BOOST_FUSION_FWD_ELEM(T, rhs));
160 return *this;
161 }
162 #endif
163 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
164 FUSION_HASH endif
165 #endif
166
167 };
168
169 template <>
170 struct deque<> : detail::nil_keyed_element
171 {
172 typedef deque_tag fusion_tag;
173 typedef bidirectional_traversal_tag category;
174 typedef mpl::int_<0> size;
175 typedef mpl::int_<0> next_up;
176 typedef mpl::int_<-1> next_down;
177 typedef mpl::false_ is_view;
178
179 template <typename Sequence>
180 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
181 deque(Sequence const&,
182 typename enable_if<
183 mpl::and_<
184 traits::is_sequence<Sequence>
185 , result_of::empty<Sequence> >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT
186 {}
187
188 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
189 deque() BOOST_NOEXCEPT {}
190 };
191
192 }}
193
194 #undef FUSION_HASH
195
196 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
197 #pragma wave option(output: null)
198 #endif
199
200 #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
201
202 #endif