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