queue revision 1.1.1.1.2.2 1 1.1.1.1.2.2 cjep // -*- C++ -*-
2 1.1.1.1.2.2 cjep //===--------------------------- queue ------------------------------------===//
3 1.1.1.1.2.2 cjep //
4 1.1.1.1.2.2 cjep // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 1.1.1.1.2.2 cjep // See https://llvm.org/LICENSE.txt for license information.
6 1.1.1.1.2.2 cjep // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 1.1.1.1.2.2 cjep //
8 1.1.1.1.2.2 cjep //===----------------------------------------------------------------------===//
9 1.1.1.1.2.2 cjep
10 1.1.1.1.2.2 cjep #ifndef _LIBCPP_QUEUE
11 1.1.1.1.2.2 cjep #define _LIBCPP_QUEUE
12 1.1.1.1.2.2 cjep
13 1.1.1.1.2.2 cjep /*
14 1.1.1.1.2.2 cjep queue synopsis
15 1.1.1.1.2.2 cjep
16 1.1.1.1.2.2 cjep namespace std
17 1.1.1.1.2.2 cjep {
18 1.1.1.1.2.2 cjep
19 1.1.1.1.2.2 cjep template <class T, class Container = deque<T>>
20 1.1.1.1.2.2 cjep class queue
21 1.1.1.1.2.2 cjep {
22 1.1.1.1.2.2 cjep public:
23 1.1.1.1.2.2 cjep typedef Container container_type;
24 1.1.1.1.2.2 cjep typedef typename container_type::value_type value_type;
25 1.1.1.1.2.2 cjep typedef typename container_type::reference reference;
26 1.1.1.1.2.2 cjep typedef typename container_type::const_reference const_reference;
27 1.1.1.1.2.2 cjep typedef typename container_type::size_type size_type;
28 1.1.1.1.2.2 cjep
29 1.1.1.1.2.2 cjep protected:
30 1.1.1.1.2.2 cjep container_type c;
31 1.1.1.1.2.2 cjep
32 1.1.1.1.2.2 cjep public:
33 1.1.1.1.2.2 cjep queue() = default;
34 1.1.1.1.2.2 cjep ~queue() = default;
35 1.1.1.1.2.2 cjep
36 1.1.1.1.2.2 cjep queue(const queue& q) = default;
37 1.1.1.1.2.2 cjep queue(queue&& q) = default;
38 1.1.1.1.2.2 cjep
39 1.1.1.1.2.2 cjep queue& operator=(const queue& q) = default;
40 1.1.1.1.2.2 cjep queue& operator=(queue&& q) = default;
41 1.1.1.1.2.2 cjep
42 1.1.1.1.2.2 cjep explicit queue(const container_type& c);
43 1.1.1.1.2.2 cjep explicit queue(container_type&& c)
44 1.1.1.1.2.2 cjep template <class Alloc>
45 1.1.1.1.2.2 cjep explicit queue(const Alloc& a);
46 1.1.1.1.2.2 cjep template <class Alloc>
47 1.1.1.1.2.2 cjep queue(const container_type& c, const Alloc& a);
48 1.1.1.1.2.2 cjep template <class Alloc>
49 1.1.1.1.2.2 cjep queue(container_type&& c, const Alloc& a);
50 1.1.1.1.2.2 cjep template <class Alloc>
51 1.1.1.1.2.2 cjep queue(const queue& q, const Alloc& a);
52 1.1.1.1.2.2 cjep template <class Alloc>
53 1.1.1.1.2.2 cjep queue(queue&& q, const Alloc& a);
54 1.1.1.1.2.2 cjep
55 1.1.1.1.2.2 cjep bool empty() const;
56 1.1.1.1.2.2 cjep size_type size() const;
57 1.1.1.1.2.2 cjep
58 1.1.1.1.2.2 cjep reference front();
59 1.1.1.1.2.2 cjep const_reference front() const;
60 1.1.1.1.2.2 cjep reference back();
61 1.1.1.1.2.2 cjep const_reference back() const;
62 1.1.1.1.2.2 cjep
63 1.1.1.1.2.2 cjep void push(const value_type& v);
64 1.1.1.1.2.2 cjep void push(value_type&& v);
65 1.1.1.1.2.2 cjep template <class... Args> reference emplace(Args&&... args); // reference in C++17
66 1.1.1.1.2.2 cjep void pop();
67 1.1.1.1.2.2 cjep
68 1.1.1.1.2.2 cjep void swap(queue& q) noexcept(is_nothrow_swappable_v<Container>)
69 1.1.1.1.2.2 cjep };
70 1.1.1.1.2.2 cjep
71 1.1.1.1.2.2 cjep template<class Container>
72 1.1.1.1.2.2 cjep queue(Container) -> queue<typename Container::value_type, Container>; // C++17
73 1.1.1.1.2.2 cjep
74 1.1.1.1.2.2 cjep template<class Container, class Allocator>
75 1.1.1.1.2.2 cjep queue(Container, Allocator) -> queue<typename Container::value_type, Container>; // C++17
76 1.1.1.1.2.2 cjep
77 1.1.1.1.2.2 cjep template <class T, class Container>
78 1.1.1.1.2.2 cjep bool operator==(const queue<T, Container>& x,const queue<T, Container>& y);
79 1.1.1.1.2.2 cjep
80 1.1.1.1.2.2 cjep template <class T, class Container>
81 1.1.1.1.2.2 cjep bool operator< (const queue<T, Container>& x,const queue<T, Container>& y);
82 1.1.1.1.2.2 cjep
83 1.1.1.1.2.2 cjep template <class T, class Container>
84 1.1.1.1.2.2 cjep bool operator!=(const queue<T, Container>& x,const queue<T, Container>& y);
85 1.1.1.1.2.2 cjep
86 1.1.1.1.2.2 cjep template <class T, class Container>
87 1.1.1.1.2.2 cjep bool operator> (const queue<T, Container>& x,const queue<T, Container>& y);
88 1.1.1.1.2.2 cjep
89 1.1.1.1.2.2 cjep template <class T, class Container>
90 1.1.1.1.2.2 cjep bool operator>=(const queue<T, Container>& x,const queue<T, Container>& y);
91 1.1.1.1.2.2 cjep
92 1.1.1.1.2.2 cjep template <class T, class Container>
93 1.1.1.1.2.2 cjep bool operator<=(const queue<T, Container>& x,const queue<T, Container>& y);
94 1.1.1.1.2.2 cjep
95 1.1.1.1.2.2 cjep template <class T, class Container>
96 1.1.1.1.2.2 cjep void swap(queue<T, Container>& x, queue<T, Container>& y)
97 1.1.1.1.2.2 cjep noexcept(noexcept(x.swap(y)));
98 1.1.1.1.2.2 cjep
99 1.1.1.1.2.2 cjep template <class T, class Container = vector<T>,
100 1.1.1.1.2.2 cjep class Compare = less<typename Container::value_type>>
101 1.1.1.1.2.2 cjep class priority_queue
102 1.1.1.1.2.2 cjep {
103 1.1.1.1.2.2 cjep public:
104 1.1.1.1.2.2 cjep typedef Container container_type;
105 1.1.1.1.2.2 cjep typedef typename container_type::value_type value_type;
106 1.1.1.1.2.2 cjep typedef typename container_type::reference reference;
107 1.1.1.1.2.2 cjep typedef typename container_type::const_reference const_reference;
108 1.1.1.1.2.2 cjep typedef typename container_type::size_type size_type;
109 1.1.1.1.2.2 cjep
110 1.1.1.1.2.2 cjep protected:
111 1.1.1.1.2.2 cjep container_type c;
112 1.1.1.1.2.2 cjep Compare comp;
113 1.1.1.1.2.2 cjep
114 1.1.1.1.2.2 cjep public:
115 1.1.1.1.2.2 cjep priority_queue() : priority_queue(Compare()) {} // C++20
116 1.1.1.1.2.2 cjep explicit priority_queue(const Compare& x) : priority_queue(x, Container()) {}
117 1.1.1.1.2.2 cjep priority_queue(const Compare& x, const Container&);
118 1.1.1.1.2.2 cjep explicit priority_queue(const Compare& x = Compare(), Container&&= Container()); // before C++20
119 1.1.1.1.2.2 cjep priority_queue(const Compare& x, Container&&); // C++20
120 1.1.1.1.2.2 cjep template <class InputIterator>
121 1.1.1.1.2.2 cjep priority_queue(InputIterator first, InputIterator last,
122 1.1.1.1.2.2 cjep const Compare& comp = Compare());
123 1.1.1.1.2.2 cjep template <class InputIterator>
124 1.1.1.1.2.2 cjep priority_queue(InputIterator first, InputIterator last,
125 1.1.1.1.2.2 cjep const Compare& comp, const container_type& c);
126 1.1.1.1.2.2 cjep template <class InputIterator>
127 1.1.1.1.2.2 cjep priority_queue(InputIterator first, InputIterator last,
128 1.1.1.1.2.2 cjep const Compare& comp, container_type&& c);
129 1.1.1.1.2.2 cjep template <class Alloc>
130 1.1.1.1.2.2 cjep explicit priority_queue(const Alloc& a);
131 1.1.1.1.2.2 cjep template <class Alloc>
132 1.1.1.1.2.2 cjep priority_queue(const Compare& comp, const Alloc& a);
133 1.1.1.1.2.2 cjep template <class Alloc>
134 1.1.1.1.2.2 cjep priority_queue(const Compare& comp, const container_type& c,
135 1.1.1.1.2.2 cjep const Alloc& a);
136 1.1.1.1.2.2 cjep template <class Alloc>
137 1.1.1.1.2.2 cjep priority_queue(const Compare& comp, container_type&& c,
138 1.1.1.1.2.2 cjep const Alloc& a);
139 1.1.1.1.2.2 cjep template <class Alloc>
140 1.1.1.1.2.2 cjep priority_queue(const priority_queue& q, const Alloc& a);
141 1.1.1.1.2.2 cjep template <class Alloc>
142 1.1.1.1.2.2 cjep priority_queue(priority_queue&& q, const Alloc& a);
143 1.1.1.1.2.2 cjep
144 1.1.1.1.2.2 cjep bool empty() const;
145 1.1.1.1.2.2 cjep size_type size() const;
146 1.1.1.1.2.2 cjep const_reference top() const;
147 1.1.1.1.2.2 cjep
148 1.1.1.1.2.2 cjep void push(const value_type& v);
149 1.1.1.1.2.2 cjep void push(value_type&& v);
150 1.1.1.1.2.2 cjep template <class... Args> void emplace(Args&&... args);
151 1.1.1.1.2.2 cjep void pop();
152 1.1.1.1.2.2 cjep
153 1.1.1.1.2.2 cjep void swap(priority_queue& q)
154 1.1.1.1.2.2 cjep noexcept(is_nothrow_swappable_v<Container> &&
155 1.1.1.1.2.2 cjep is_nothrow_swappable_v<Comp>)
156 1.1.1.1.2.2 cjep };
157 1.1.1.1.2.2 cjep
158 1.1.1.1.2.2 cjep template <class Compare, class Container>
159 1.1.1.1.2.2 cjep priority_queue(Compare, Container)
160 1.1.1.1.2.2 cjep -> priority_queue<typename Container::value_type, Container, Compare>; // C++17
161 1.1.1.1.2.2 cjep
162 1.1.1.1.2.2 cjep template<class InputIterator,
163 1.1.1.1.2.2 cjep class Compare = less<typename iterator_traits<InputIterator>::value_type>,
164 1.1.1.1.2.2 cjep class Container = vector<typename iterator_traits<InputIterator>::value_type>>
165 1.1.1.1.2.2 cjep priority_queue(InputIterator, InputIterator, Compare = Compare(), Container = Container())
166 1.1.1.1.2.2 cjep -> priority_queue<typename iterator_traits<InputIterator>::value_type, Container, Compare>; // C++17
167 1.1.1.1.2.2 cjep
168 1.1.1.1.2.2 cjep template<class Compare, class Container, class Allocator>
169 1.1.1.1.2.2 cjep priority_queue(Compare, Container, Allocator)
170 1.1.1.1.2.2 cjep -> priority_queue<typename Container::value_type, Container, Compare>; // C++17
171 1.1.1.1.2.2 cjep
172 1.1.1.1.2.2 cjep template <class T, class Container, class Compare>
173 1.1.1.1.2.2 cjep void swap(priority_queue<T, Container, Compare>& x,
174 1.1.1.1.2.2 cjep priority_queue<T, Container, Compare>& y)
175 1.1.1.1.2.2 cjep noexcept(noexcept(x.swap(y)));
176 1.1.1.1.2.2 cjep
177 1.1.1.1.2.2 cjep } // std
178 1.1.1.1.2.2 cjep
179 1.1.1.1.2.2 cjep */
180 1.1.1.1.2.2 cjep
181 1.1.1.1.2.2 cjep #include <__config>
182 1.1.1.1.2.2 cjep #include <compare>
183 1.1.1.1.2.2 cjep #include <deque>
184 1.1.1.1.2.2 cjep #include <vector>
185 1.1.1.1.2.2 cjep #include <functional>
186 1.1.1.1.2.2 cjep #include <algorithm>
187 1.1.1.1.2.2 cjep
188 1.1.1.1.2.2 cjep #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
189 1.1.1.1.2.2 cjep #pragma GCC system_header
190 1.1.1.1.2.2 cjep #endif
191 1.1.1.1.2.2 cjep
192 1.1.1.1.2.2 cjep _LIBCPP_BEGIN_NAMESPACE_STD
193 1.1.1.1.2.2 cjep
194 1.1.1.1.2.2 cjep template <class _Tp, class _Container = deque<_Tp> > class _LIBCPP_TEMPLATE_VIS queue;
195 1.1.1.1.2.2 cjep
196 1.1.1.1.2.2 cjep template <class _Tp, class _Container>
197 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
198 1.1.1.1.2.2 cjep bool
199 1.1.1.1.2.2 cjep operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
200 1.1.1.1.2.2 cjep
201 1.1.1.1.2.2 cjep template <class _Tp, class _Container>
202 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
203 1.1.1.1.2.2 cjep bool
204 1.1.1.1.2.2 cjep operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
205 1.1.1.1.2.2 cjep
206 1.1.1.1.2.2 cjep template <class _Tp, class _Container /*= deque<_Tp>*/>
207 1.1.1.1.2.2 cjep class _LIBCPP_TEMPLATE_VIS queue
208 1.1.1.1.2.2 cjep {
209 1.1.1.1.2.2 cjep public:
210 1.1.1.1.2.2 cjep typedef _Container container_type;
211 1.1.1.1.2.2 cjep typedef typename container_type::value_type value_type;
212 1.1.1.1.2.2 cjep typedef typename container_type::reference reference;
213 1.1.1.1.2.2 cjep typedef typename container_type::const_reference const_reference;
214 1.1.1.1.2.2 cjep typedef typename container_type::size_type size_type;
215 1.1.1.1.2.2 cjep static_assert((is_same<_Tp, value_type>::value), "" );
216 1.1.1.1.2.2 cjep
217 1.1.1.1.2.2 cjep protected:
218 1.1.1.1.2.2 cjep container_type c;
219 1.1.1.1.2.2 cjep
220 1.1.1.1.2.2 cjep public:
221 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
222 1.1.1.1.2.2 cjep queue()
223 1.1.1.1.2.2 cjep _NOEXCEPT_(is_nothrow_default_constructible<container_type>::value)
224 1.1.1.1.2.2 cjep : c() {}
225 1.1.1.1.2.2 cjep
226 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
227 1.1.1.1.2.2 cjep queue(const queue& __q) : c(__q.c) {}
228 1.1.1.1.2.2 cjep
229 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
230 1.1.1.1.2.2 cjep queue& operator=(const queue& __q) {c = __q.c; return *this;}
231 1.1.1.1.2.2 cjep
232 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
233 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
234 1.1.1.1.2.2 cjep queue(queue&& __q)
235 1.1.1.1.2.2 cjep _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
236 1.1.1.1.2.2 cjep : c(_VSTD::move(__q.c)) {}
237 1.1.1.1.2.2 cjep
238 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
239 1.1.1.1.2.2 cjep queue& operator=(queue&& __q)
240 1.1.1.1.2.2 cjep _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
241 1.1.1.1.2.2 cjep {c = _VSTD::move(__q.c); return *this;}
242 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
243 1.1.1.1.2.2 cjep
244 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
245 1.1.1.1.2.2 cjep explicit queue(const container_type& __c) : c(__c) {}
246 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
247 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
248 1.1.1.1.2.2 cjep explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {}
249 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
250 1.1.1.1.2.2 cjep template <class _Alloc>
251 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
252 1.1.1.1.2.2 cjep explicit queue(const _Alloc& __a,
253 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
254 1.1.1.1.2.2 cjep : c(__a) {}
255 1.1.1.1.2.2 cjep template <class _Alloc>
256 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
257 1.1.1.1.2.2 cjep queue(const queue& __q, const _Alloc& __a,
258 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
259 1.1.1.1.2.2 cjep : c(__q.c, __a) {}
260 1.1.1.1.2.2 cjep template <class _Alloc>
261 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
262 1.1.1.1.2.2 cjep queue(const container_type& __c, const _Alloc& __a,
263 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
264 1.1.1.1.2.2 cjep : c(__c, __a) {}
265 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
266 1.1.1.1.2.2 cjep template <class _Alloc>
267 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
268 1.1.1.1.2.2 cjep queue(container_type&& __c, const _Alloc& __a,
269 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
270 1.1.1.1.2.2 cjep : c(_VSTD::move(__c), __a) {}
271 1.1.1.1.2.2 cjep template <class _Alloc>
272 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
273 1.1.1.1.2.2 cjep queue(queue&& __q, const _Alloc& __a,
274 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
275 1.1.1.1.2.2 cjep : c(_VSTD::move(__q.c), __a) {}
276 1.1.1.1.2.2 cjep
277 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
278 1.1.1.1.2.2 cjep
279 1.1.1.1.2.2 cjep _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
280 1.1.1.1.2.2 cjep bool empty() const {return c.empty();}
281 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
282 1.1.1.1.2.2 cjep size_type size() const {return c.size();}
283 1.1.1.1.2.2 cjep
284 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
285 1.1.1.1.2.2 cjep reference front() {return c.front();}
286 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
287 1.1.1.1.2.2 cjep const_reference front() const {return c.front();}
288 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
289 1.1.1.1.2.2 cjep reference back() {return c.back();}
290 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
291 1.1.1.1.2.2 cjep const_reference back() const {return c.back();}
292 1.1.1.1.2.2 cjep
293 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
294 1.1.1.1.2.2 cjep void push(const value_type& __v) {c.push_back(__v);}
295 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
296 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
297 1.1.1.1.2.2 cjep void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
298 1.1.1.1.2.2 cjep template <class... _Args>
299 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
300 1.1.1.1.2.2 cjep #if _LIBCPP_STD_VER > 14
301 1.1.1.1.2.2 cjep decltype(auto) emplace(_Args&&... __args)
302 1.1.1.1.2.2 cjep { return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
303 1.1.1.1.2.2 cjep #else
304 1.1.1.1.2.2 cjep void emplace(_Args&&... __args)
305 1.1.1.1.2.2 cjep { c.emplace_back(_VSTD::forward<_Args>(__args)...);}
306 1.1.1.1.2.2 cjep #endif
307 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
308 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
309 1.1.1.1.2.2 cjep void pop() {c.pop_front();}
310 1.1.1.1.2.2 cjep
311 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
312 1.1.1.1.2.2 cjep void swap(queue& __q)
313 1.1.1.1.2.2 cjep _NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
314 1.1.1.1.2.2 cjep {
315 1.1.1.1.2.2 cjep using _VSTD::swap;
316 1.1.1.1.2.2 cjep swap(c, __q.c);
317 1.1.1.1.2.2 cjep }
318 1.1.1.1.2.2 cjep
319 1.1.1.1.2.2 cjep template <class _T1, class _C1>
320 1.1.1.1.2.2 cjep friend
321 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
322 1.1.1.1.2.2 cjep bool
323 1.1.1.1.2.2 cjep operator==(const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
324 1.1.1.1.2.2 cjep
325 1.1.1.1.2.2 cjep template <class _T1, class _C1>
326 1.1.1.1.2.2 cjep friend
327 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
328 1.1.1.1.2.2 cjep bool
329 1.1.1.1.2.2 cjep operator< (const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
330 1.1.1.1.2.2 cjep };
331 1.1.1.1.2.2 cjep
332 1.1.1.1.2.2 cjep #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
333 1.1.1.1.2.2 cjep template<class _Container,
334 1.1.1.1.2.2 cjep class = _EnableIf<!__is_allocator<_Container>::value>
335 1.1.1.1.2.2 cjep >
336 1.1.1.1.2.2 cjep queue(_Container)
337 1.1.1.1.2.2 cjep -> queue<typename _Container::value_type, _Container>;
338 1.1.1.1.2.2 cjep
339 1.1.1.1.2.2 cjep template<class _Container,
340 1.1.1.1.2.2 cjep class _Alloc,
341 1.1.1.1.2.2 cjep class = _EnableIf<!__is_allocator<_Container>::value>,
342 1.1.1.1.2.2 cjep class = _EnableIf<__is_allocator<_Alloc>::value>
343 1.1.1.1.2.2 cjep >
344 1.1.1.1.2.2 cjep queue(_Container, _Alloc)
345 1.1.1.1.2.2 cjep -> queue<typename _Container::value_type, _Container>;
346 1.1.1.1.2.2 cjep #endif
347 1.1.1.1.2.2 cjep
348 1.1.1.1.2.2 cjep template <class _Tp, class _Container>
349 1.1.1.1.2.2 cjep inline _LIBCPP_INLINE_VISIBILITY
350 1.1.1.1.2.2 cjep bool
351 1.1.1.1.2.2 cjep operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
352 1.1.1.1.2.2 cjep {
353 1.1.1.1.2.2 cjep return __x.c == __y.c;
354 1.1.1.1.2.2 cjep }
355 1.1.1.1.2.2 cjep
356 1.1.1.1.2.2 cjep template <class _Tp, class _Container>
357 1.1.1.1.2.2 cjep inline _LIBCPP_INLINE_VISIBILITY
358 1.1.1.1.2.2 cjep bool
359 1.1.1.1.2.2 cjep operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
360 1.1.1.1.2.2 cjep {
361 1.1.1.1.2.2 cjep return __x.c < __y.c;
362 1.1.1.1.2.2 cjep }
363 1.1.1.1.2.2 cjep
364 1.1.1.1.2.2 cjep template <class _Tp, class _Container>
365 1.1.1.1.2.2 cjep inline _LIBCPP_INLINE_VISIBILITY
366 1.1.1.1.2.2 cjep bool
367 1.1.1.1.2.2 cjep operator!=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
368 1.1.1.1.2.2 cjep {
369 1.1.1.1.2.2 cjep return !(__x == __y);
370 1.1.1.1.2.2 cjep }
371 1.1.1.1.2.2 cjep
372 1.1.1.1.2.2 cjep template <class _Tp, class _Container>
373 1.1.1.1.2.2 cjep inline _LIBCPP_INLINE_VISIBILITY
374 1.1.1.1.2.2 cjep bool
375 1.1.1.1.2.2 cjep operator> (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
376 1.1.1.1.2.2 cjep {
377 1.1.1.1.2.2 cjep return __y < __x;
378 1.1.1.1.2.2 cjep }
379 1.1.1.1.2.2 cjep
380 1.1.1.1.2.2 cjep template <class _Tp, class _Container>
381 1.1.1.1.2.2 cjep inline _LIBCPP_INLINE_VISIBILITY
382 1.1.1.1.2.2 cjep bool
383 1.1.1.1.2.2 cjep operator>=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
384 1.1.1.1.2.2 cjep {
385 1.1.1.1.2.2 cjep return !(__x < __y);
386 1.1.1.1.2.2 cjep }
387 1.1.1.1.2.2 cjep
388 1.1.1.1.2.2 cjep template <class _Tp, class _Container>
389 1.1.1.1.2.2 cjep inline _LIBCPP_INLINE_VISIBILITY
390 1.1.1.1.2.2 cjep bool
391 1.1.1.1.2.2 cjep operator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
392 1.1.1.1.2.2 cjep {
393 1.1.1.1.2.2 cjep return !(__y < __x);
394 1.1.1.1.2.2 cjep }
395 1.1.1.1.2.2 cjep
396 1.1.1.1.2.2 cjep template <class _Tp, class _Container>
397 1.1.1.1.2.2 cjep inline _LIBCPP_INLINE_VISIBILITY
398 1.1.1.1.2.2 cjep _EnableIf<__is_swappable<_Container>::value, void>
399 1.1.1.1.2.2 cjep swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
400 1.1.1.1.2.2 cjep _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
401 1.1.1.1.2.2 cjep {
402 1.1.1.1.2.2 cjep __x.swap(__y);
403 1.1.1.1.2.2 cjep }
404 1.1.1.1.2.2 cjep
405 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Alloc>
406 1.1.1.1.2.2 cjep struct _LIBCPP_TEMPLATE_VIS uses_allocator<queue<_Tp, _Container>, _Alloc>
407 1.1.1.1.2.2 cjep : public uses_allocator<_Container, _Alloc>
408 1.1.1.1.2.2 cjep {
409 1.1.1.1.2.2 cjep };
410 1.1.1.1.2.2 cjep
411 1.1.1.1.2.2 cjep template <class _Tp, class _Container = vector<_Tp>,
412 1.1.1.1.2.2 cjep class _Compare = less<typename _Container::value_type> >
413 1.1.1.1.2.2 cjep class _LIBCPP_TEMPLATE_VIS priority_queue
414 1.1.1.1.2.2 cjep {
415 1.1.1.1.2.2 cjep public:
416 1.1.1.1.2.2 cjep typedef _Container container_type;
417 1.1.1.1.2.2 cjep typedef _Compare value_compare;
418 1.1.1.1.2.2 cjep typedef typename container_type::value_type value_type;
419 1.1.1.1.2.2 cjep typedef typename container_type::reference reference;
420 1.1.1.1.2.2 cjep typedef typename container_type::const_reference const_reference;
421 1.1.1.1.2.2 cjep typedef typename container_type::size_type size_type;
422 1.1.1.1.2.2 cjep static_assert((is_same<_Tp, value_type>::value), "" );
423 1.1.1.1.2.2 cjep
424 1.1.1.1.2.2 cjep protected:
425 1.1.1.1.2.2 cjep container_type c;
426 1.1.1.1.2.2 cjep value_compare comp;
427 1.1.1.1.2.2 cjep
428 1.1.1.1.2.2 cjep public:
429 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
430 1.1.1.1.2.2 cjep priority_queue()
431 1.1.1.1.2.2 cjep _NOEXCEPT_(is_nothrow_default_constructible<container_type>::value &&
432 1.1.1.1.2.2 cjep is_nothrow_default_constructible<value_compare>::value)
433 1.1.1.1.2.2 cjep : c(), comp() {}
434 1.1.1.1.2.2 cjep
435 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
436 1.1.1.1.2.2 cjep priority_queue(const priority_queue& __q) : c(__q.c), comp(__q.comp) {}
437 1.1.1.1.2.2 cjep
438 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
439 1.1.1.1.2.2 cjep priority_queue& operator=(const priority_queue& __q)
440 1.1.1.1.2.2 cjep {c = __q.c; comp = __q.comp; return *this;}
441 1.1.1.1.2.2 cjep
442 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
443 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
444 1.1.1.1.2.2 cjep priority_queue(priority_queue&& __q)
445 1.1.1.1.2.2 cjep _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value &&
446 1.1.1.1.2.2 cjep is_nothrow_move_constructible<value_compare>::value)
447 1.1.1.1.2.2 cjep : c(_VSTD::move(__q.c)), comp(_VSTD::move(__q.comp)) {}
448 1.1.1.1.2.2 cjep
449 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
450 1.1.1.1.2.2 cjep priority_queue& operator=(priority_queue&& __q)
451 1.1.1.1.2.2 cjep _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value &&
452 1.1.1.1.2.2 cjep is_nothrow_move_assignable<value_compare>::value)
453 1.1.1.1.2.2 cjep {c = _VSTD::move(__q.c); comp = _VSTD::move(__q.comp); return *this;}
454 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
455 1.1.1.1.2.2 cjep
456 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
457 1.1.1.1.2.2 cjep explicit priority_queue(const value_compare& __comp)
458 1.1.1.1.2.2 cjep : c(), comp(__comp) {}
459 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
460 1.1.1.1.2.2 cjep priority_queue(const value_compare& __comp, const container_type& __c);
461 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
462 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
463 1.1.1.1.2.2 cjep priority_queue(const value_compare& __comp, container_type&& __c);
464 1.1.1.1.2.2 cjep #endif
465 1.1.1.1.2.2 cjep template <class _InputIter>
466 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
467 1.1.1.1.2.2 cjep priority_queue(_InputIter __f, _InputIter __l,
468 1.1.1.1.2.2 cjep const value_compare& __comp = value_compare());
469 1.1.1.1.2.2 cjep template <class _InputIter>
470 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
471 1.1.1.1.2.2 cjep priority_queue(_InputIter __f, _InputIter __l,
472 1.1.1.1.2.2 cjep const value_compare& __comp, const container_type& __c);
473 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
474 1.1.1.1.2.2 cjep template <class _InputIter>
475 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
476 1.1.1.1.2.2 cjep priority_queue(_InputIter __f, _InputIter __l,
477 1.1.1.1.2.2 cjep const value_compare& __comp, container_type&& __c);
478 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
479 1.1.1.1.2.2 cjep template <class _Alloc>
480 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
481 1.1.1.1.2.2 cjep explicit priority_queue(const _Alloc& __a,
482 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
483 1.1.1.1.2.2 cjep template <class _Alloc>
484 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
485 1.1.1.1.2.2 cjep priority_queue(const value_compare& __comp, const _Alloc& __a,
486 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
487 1.1.1.1.2.2 cjep template <class _Alloc>
488 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
489 1.1.1.1.2.2 cjep priority_queue(const value_compare& __comp, const container_type& __c,
490 1.1.1.1.2.2 cjep const _Alloc& __a,
491 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
492 1.1.1.1.2.2 cjep template <class _Alloc>
493 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
494 1.1.1.1.2.2 cjep priority_queue(const priority_queue& __q, const _Alloc& __a,
495 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
496 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
497 1.1.1.1.2.2 cjep template <class _Alloc>
498 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
499 1.1.1.1.2.2 cjep priority_queue(const value_compare& __comp, container_type&& __c,
500 1.1.1.1.2.2 cjep const _Alloc& __a,
501 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
502 1.1.1.1.2.2 cjep template <class _Alloc>
503 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
504 1.1.1.1.2.2 cjep priority_queue(priority_queue&& __q, const _Alloc& __a,
505 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
506 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
507 1.1.1.1.2.2 cjep
508 1.1.1.1.2.2 cjep _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
509 1.1.1.1.2.2 cjep bool empty() const {return c.empty();}
510 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
511 1.1.1.1.2.2 cjep size_type size() const {return c.size();}
512 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
513 1.1.1.1.2.2 cjep const_reference top() const {return c.front();}
514 1.1.1.1.2.2 cjep
515 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
516 1.1.1.1.2.2 cjep void push(const value_type& __v);
517 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
518 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
519 1.1.1.1.2.2 cjep void push(value_type&& __v);
520 1.1.1.1.2.2 cjep template <class... _Args>
521 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
522 1.1.1.1.2.2 cjep void emplace(_Args&&... __args);
523 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
524 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
525 1.1.1.1.2.2 cjep void pop();
526 1.1.1.1.2.2 cjep
527 1.1.1.1.2.2 cjep _LIBCPP_INLINE_VISIBILITY
528 1.1.1.1.2.2 cjep void swap(priority_queue& __q)
529 1.1.1.1.2.2 cjep _NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
530 1.1.1.1.2.2 cjep __is_nothrow_swappable<value_compare>::value);
531 1.1.1.1.2.2 cjep };
532 1.1.1.1.2.2 cjep
533 1.1.1.1.2.2 cjep #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
534 1.1.1.1.2.2 cjep template <class _Compare,
535 1.1.1.1.2.2 cjep class _Container,
536 1.1.1.1.2.2 cjep class = _EnableIf<!__is_allocator<_Compare>::value>,
537 1.1.1.1.2.2 cjep class = _EnableIf<!__is_allocator<_Container>::value>
538 1.1.1.1.2.2 cjep >
539 1.1.1.1.2.2 cjep priority_queue(_Compare, _Container)
540 1.1.1.1.2.2 cjep -> priority_queue<typename _Container::value_type, _Container, _Compare>;
541 1.1.1.1.2.2 cjep
542 1.1.1.1.2.2 cjep template<class _InputIterator,
543 1.1.1.1.2.2 cjep class _Compare = less<__iter_value_type<_InputIterator>>,
544 1.1.1.1.2.2 cjep class _Container = vector<__iter_value_type<_InputIterator>>,
545 1.1.1.1.2.2 cjep class = _EnableIf<__is_cpp17_input_iterator<_InputIterator>::value>,
546 1.1.1.1.2.2 cjep class = _EnableIf<!__is_allocator<_Compare>::value>,
547 1.1.1.1.2.2 cjep class = _EnableIf<!__is_allocator<_Container>::value>
548 1.1.1.1.2.2 cjep >
549 1.1.1.1.2.2 cjep priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(), _Container = _Container())
550 1.1.1.1.2.2 cjep -> priority_queue<__iter_value_type<_InputIterator>, _Container, _Compare>;
551 1.1.1.1.2.2 cjep
552 1.1.1.1.2.2 cjep template<class _Compare,
553 1.1.1.1.2.2 cjep class _Container,
554 1.1.1.1.2.2 cjep class _Alloc,
555 1.1.1.1.2.2 cjep class = _EnableIf<!__is_allocator<_Compare>::value>,
556 1.1.1.1.2.2 cjep class = _EnableIf<!__is_allocator<_Container>::value>,
557 1.1.1.1.2.2 cjep class = _EnableIf<__is_allocator<_Alloc>::value>
558 1.1.1.1.2.2 cjep >
559 1.1.1.1.2.2 cjep priority_queue(_Compare, _Container, _Alloc)
560 1.1.1.1.2.2 cjep -> priority_queue<typename _Container::value_type, _Container, _Compare>;
561 1.1.1.1.2.2 cjep #endif
562 1.1.1.1.2.2 cjep
563 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
564 1.1.1.1.2.2 cjep inline
565 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp,
566 1.1.1.1.2.2 cjep const container_type& __c)
567 1.1.1.1.2.2 cjep : c(__c),
568 1.1.1.1.2.2 cjep comp(__comp)
569 1.1.1.1.2.2 cjep {
570 1.1.1.1.2.2 cjep _VSTD::make_heap(c.begin(), c.end(), comp);
571 1.1.1.1.2.2 cjep }
572 1.1.1.1.2.2 cjep
573 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
574 1.1.1.1.2.2 cjep
575 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
576 1.1.1.1.2.2 cjep inline
577 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
578 1.1.1.1.2.2 cjep container_type&& __c)
579 1.1.1.1.2.2 cjep : c(_VSTD::move(__c)),
580 1.1.1.1.2.2 cjep comp(__comp)
581 1.1.1.1.2.2 cjep {
582 1.1.1.1.2.2 cjep _VSTD::make_heap(c.begin(), c.end(), comp);
583 1.1.1.1.2.2 cjep }
584 1.1.1.1.2.2 cjep
585 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
586 1.1.1.1.2.2 cjep
587 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
588 1.1.1.1.2.2 cjep template <class _InputIter>
589 1.1.1.1.2.2 cjep inline
590 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
591 1.1.1.1.2.2 cjep const value_compare& __comp)
592 1.1.1.1.2.2 cjep : c(__f, __l),
593 1.1.1.1.2.2 cjep comp(__comp)
594 1.1.1.1.2.2 cjep {
595 1.1.1.1.2.2 cjep _VSTD::make_heap(c.begin(), c.end(), comp);
596 1.1.1.1.2.2 cjep }
597 1.1.1.1.2.2 cjep
598 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
599 1.1.1.1.2.2 cjep template <class _InputIter>
600 1.1.1.1.2.2 cjep inline
601 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
602 1.1.1.1.2.2 cjep const value_compare& __comp,
603 1.1.1.1.2.2 cjep const container_type& __c)
604 1.1.1.1.2.2 cjep : c(__c),
605 1.1.1.1.2.2 cjep comp(__comp)
606 1.1.1.1.2.2 cjep {
607 1.1.1.1.2.2 cjep c.insert(c.end(), __f, __l);
608 1.1.1.1.2.2 cjep _VSTD::make_heap(c.begin(), c.end(), comp);
609 1.1.1.1.2.2 cjep }
610 1.1.1.1.2.2 cjep
611 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
612 1.1.1.1.2.2 cjep
613 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
614 1.1.1.1.2.2 cjep template <class _InputIter>
615 1.1.1.1.2.2 cjep inline
616 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
617 1.1.1.1.2.2 cjep const value_compare& __comp,
618 1.1.1.1.2.2 cjep container_type&& __c)
619 1.1.1.1.2.2 cjep : c(_VSTD::move(__c)),
620 1.1.1.1.2.2 cjep comp(__comp)
621 1.1.1.1.2.2 cjep {
622 1.1.1.1.2.2 cjep c.insert(c.end(), __f, __l);
623 1.1.1.1.2.2 cjep _VSTD::make_heap(c.begin(), c.end(), comp);
624 1.1.1.1.2.2 cjep }
625 1.1.1.1.2.2 cjep
626 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
627 1.1.1.1.2.2 cjep
628 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
629 1.1.1.1.2.2 cjep template <class _Alloc>
630 1.1.1.1.2.2 cjep inline
631 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a,
632 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
633 1.1.1.1.2.2 cjep : c(__a)
634 1.1.1.1.2.2 cjep {
635 1.1.1.1.2.2 cjep }
636 1.1.1.1.2.2 cjep
637 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
638 1.1.1.1.2.2 cjep template <class _Alloc>
639 1.1.1.1.2.2 cjep inline
640 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
641 1.1.1.1.2.2 cjep const _Alloc& __a,
642 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
643 1.1.1.1.2.2 cjep : c(__a),
644 1.1.1.1.2.2 cjep comp(__comp)
645 1.1.1.1.2.2 cjep {
646 1.1.1.1.2.2 cjep }
647 1.1.1.1.2.2 cjep
648 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
649 1.1.1.1.2.2 cjep template <class _Alloc>
650 1.1.1.1.2.2 cjep inline
651 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
652 1.1.1.1.2.2 cjep const container_type& __c,
653 1.1.1.1.2.2 cjep const _Alloc& __a,
654 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
655 1.1.1.1.2.2 cjep : c(__c, __a),
656 1.1.1.1.2.2 cjep comp(__comp)
657 1.1.1.1.2.2 cjep {
658 1.1.1.1.2.2 cjep _VSTD::make_heap(c.begin(), c.end(), comp);
659 1.1.1.1.2.2 cjep }
660 1.1.1.1.2.2 cjep
661 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
662 1.1.1.1.2.2 cjep template <class _Alloc>
663 1.1.1.1.2.2 cjep inline
664 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue& __q,
665 1.1.1.1.2.2 cjep const _Alloc& __a,
666 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
667 1.1.1.1.2.2 cjep : c(__q.c, __a),
668 1.1.1.1.2.2 cjep comp(__q.comp)
669 1.1.1.1.2.2 cjep {
670 1.1.1.1.2.2 cjep _VSTD::make_heap(c.begin(), c.end(), comp);
671 1.1.1.1.2.2 cjep }
672 1.1.1.1.2.2 cjep
673 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
674 1.1.1.1.2.2 cjep
675 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
676 1.1.1.1.2.2 cjep template <class _Alloc>
677 1.1.1.1.2.2 cjep inline
678 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
679 1.1.1.1.2.2 cjep container_type&& __c,
680 1.1.1.1.2.2 cjep const _Alloc& __a,
681 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
682 1.1.1.1.2.2 cjep : c(_VSTD::move(__c), __a),
683 1.1.1.1.2.2 cjep comp(__comp)
684 1.1.1.1.2.2 cjep {
685 1.1.1.1.2.2 cjep _VSTD::make_heap(c.begin(), c.end(), comp);
686 1.1.1.1.2.2 cjep }
687 1.1.1.1.2.2 cjep
688 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
689 1.1.1.1.2.2 cjep template <class _Alloc>
690 1.1.1.1.2.2 cjep inline
691 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q,
692 1.1.1.1.2.2 cjep const _Alloc& __a,
693 1.1.1.1.2.2 cjep _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
694 1.1.1.1.2.2 cjep : c(_VSTD::move(__q.c), __a),
695 1.1.1.1.2.2 cjep comp(_VSTD::move(__q.comp))
696 1.1.1.1.2.2 cjep {
697 1.1.1.1.2.2 cjep _VSTD::make_heap(c.begin(), c.end(), comp);
698 1.1.1.1.2.2 cjep }
699 1.1.1.1.2.2 cjep
700 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
701 1.1.1.1.2.2 cjep
702 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
703 1.1.1.1.2.2 cjep inline
704 1.1.1.1.2.2 cjep void
705 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v)
706 1.1.1.1.2.2 cjep {
707 1.1.1.1.2.2 cjep c.push_back(__v);
708 1.1.1.1.2.2 cjep _VSTD::push_heap(c.begin(), c.end(), comp);
709 1.1.1.1.2.2 cjep }
710 1.1.1.1.2.2 cjep
711 1.1.1.1.2.2 cjep #ifndef _LIBCPP_CXX03_LANG
712 1.1.1.1.2.2 cjep
713 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
714 1.1.1.1.2.2 cjep inline
715 1.1.1.1.2.2 cjep void
716 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v)
717 1.1.1.1.2.2 cjep {
718 1.1.1.1.2.2 cjep c.push_back(_VSTD::move(__v));
719 1.1.1.1.2.2 cjep _VSTD::push_heap(c.begin(), c.end(), comp);
720 1.1.1.1.2.2 cjep }
721 1.1.1.1.2.2 cjep
722 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
723 1.1.1.1.2.2 cjep template <class... _Args>
724 1.1.1.1.2.2 cjep inline
725 1.1.1.1.2.2 cjep void
726 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args)
727 1.1.1.1.2.2 cjep {
728 1.1.1.1.2.2 cjep c.emplace_back(_VSTD::forward<_Args>(__args)...);
729 1.1.1.1.2.2 cjep _VSTD::push_heap(c.begin(), c.end(), comp);
730 1.1.1.1.2.2 cjep }
731 1.1.1.1.2.2 cjep
732 1.1.1.1.2.2 cjep #endif // _LIBCPP_CXX03_LANG
733 1.1.1.1.2.2 cjep
734 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
735 1.1.1.1.2.2 cjep inline
736 1.1.1.1.2.2 cjep void
737 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::pop()
738 1.1.1.1.2.2 cjep {
739 1.1.1.1.2.2 cjep _VSTD::pop_heap(c.begin(), c.end(), comp);
740 1.1.1.1.2.2 cjep c.pop_back();
741 1.1.1.1.2.2 cjep }
742 1.1.1.1.2.2 cjep
743 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
744 1.1.1.1.2.2 cjep inline
745 1.1.1.1.2.2 cjep void
746 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q)
747 1.1.1.1.2.2 cjep _NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
748 1.1.1.1.2.2 cjep __is_nothrow_swappable<value_compare>::value)
749 1.1.1.1.2.2 cjep {
750 1.1.1.1.2.2 cjep using _VSTD::swap;
751 1.1.1.1.2.2 cjep swap(c, __q.c);
752 1.1.1.1.2.2 cjep swap(comp, __q.comp);
753 1.1.1.1.2.2 cjep }
754 1.1.1.1.2.2 cjep
755 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare>
756 1.1.1.1.2.2 cjep inline _LIBCPP_INLINE_VISIBILITY
757 1.1.1.1.2.2 cjep _EnableIf<
758 1.1.1.1.2.2 cjep __is_swappable<_Container>::value && __is_swappable<_Compare>::value,
759 1.1.1.1.2.2 cjep void
760 1.1.1.1.2.2 cjep >
761 1.1.1.1.2.2 cjep swap(priority_queue<_Tp, _Container, _Compare>& __x,
762 1.1.1.1.2.2 cjep priority_queue<_Tp, _Container, _Compare>& __y)
763 1.1.1.1.2.2 cjep _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
764 1.1.1.1.2.2 cjep {
765 1.1.1.1.2.2 cjep __x.swap(__y);
766 1.1.1.1.2.2 cjep }
767 1.1.1.1.2.2 cjep
768 1.1.1.1.2.2 cjep template <class _Tp, class _Container, class _Compare, class _Alloc>
769 1.1.1.1.2.2 cjep struct _LIBCPP_TEMPLATE_VIS uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
770 1.1.1.1.2.2 cjep : public uses_allocator<_Container, _Alloc>
771 1.1.1.1.2.2 cjep {
772 1.1.1.1.2.2 cjep };
773 1.1.1.1.2.2 cjep
774 1.1.1.1.2.2 cjep _LIBCPP_END_NAMESPACE_STD
775 1.1.1.1.2.2 cjep
776 1.1.1.1.2.2 cjep #endif // _LIBCPP_QUEUE
777