BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslstl_queue_cpp03.h
Go to the documentation of this file.
1/// @file bslstl_queue_cpp03.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslstl_queue_cpp03.h -*-C++-*-
8
9// Automatically generated file. **DO NOT EDIT**
10
11#ifndef INCLUDED_BSLSTL_QUEUE_CPP03
12#define INCLUDED_BSLSTL_QUEUE_CPP03
13
14/// @defgroup bslstl_queue_cpp03 bslstl_queue_cpp03
15/// @brief Provide C++03 implementation for bslstl_queue.h
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslstl
19/// @{
20/// @addtogroup bslstl_queue_cpp03
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslstl_queue_cpp03-purpose"> Purpose</a>
25/// * <a href="#bslstl_queue_cpp03-classes"> Classes </a>
26/// * <a href="#bslstl_queue_cpp03-description"> Description </a>
27///
28/// # Purpose {#bslstl_queue_cpp03-purpose}
29/// Provide C++03 implementation for bslstl_queue.h
30///
31/// # Classes {#bslstl_queue_cpp03-classes}
32/// See bslstl_queue.h for list of classes
33///
34/// @see bslstl_queue
35///
36/// # Description {#bslstl_queue_cpp03-description}
37/// This component is the C++03 translation of a C++11 component,
38/// generated by the 'sim_cpp11_features.pl' program. If the original header
39/// contains any specially delimited regions of C++11 code, then this generated
40/// file contains the C++03 equivalent, i.e., with variadic templates expanded
41/// and rvalue-references replaced by 'bslmf::MovableRef' objects. The header
42/// code in this file is designed to be '#include'd into the original header
43/// when compiling with a C++03 compiler. If there are no specially delimited
44/// regions of C++11 code, then this header contains no code and is not
45/// '#include'd in the original header.
46///
47/// Generated on Fri May 15 12:19:50 2026
48/// Command line: sim_cpp11_features.pl bslstl_queue.h
49/// @}
50/** @} */
51/** @} */
52
53/** @addtogroup bsl
54 * @{
55 */
56/** @addtogroup bslstl
57 * @{
58 */
59/** @addtogroup bslstl_queue_cpp03
60 * @{
61 */
62
63#ifdef COMPILING_BSLSTL_QUEUE_H
64
65namespace bsl {
66
67 // ===========
68 // class queue
69 // ===========
70
71/// This class is a value-semantic class template, having a container of the
72/// parameterized `CONTAINER` type that holds elements of the parameterized
73/// `VALUE` type, to provide a first-in-first-out queue data structure. The
74/// container object held by a `queue` class object is referenced as `c` in
75/// the following function-level documentation.
76///
77/// See @ref bslstl_queue_cpp03
78template <class VALUE, class CONTAINER = deque<VALUE> >
79class queue {
80
81#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
82 // STATIC CHECK: Type mismatch is UB per C++17
84#endif
85
86 // FRIENDS
87 template <class VALUE2, class CONTAINER2>
88 friend bool operator==(const queue<VALUE2, CONTAINER2>&,
89 const queue<VALUE2, CONTAINER2>&);
90
91 template <class VALUE2, class CONTAINER2>
92 friend bool operator!=(const queue<VALUE2, CONTAINER2>&,
93 const queue<VALUE2, CONTAINER2>&);
94
95 template <class VALUE2, class CONTAINER2>
96 friend bool operator< (const queue<VALUE2, CONTAINER2>&,
97 const queue<VALUE2, CONTAINER2>&);
98
99 template <class VALUE2, class CONTAINER2>
100 friend bool operator> (const queue<VALUE2, CONTAINER2>&,
101 const queue<VALUE2, CONTAINER2>&);
102
103 template <class VALUE2, class CONTAINER2>
104 friend bool operator<=(const queue<VALUE2, CONTAINER2>&,
105 const queue<VALUE2, CONTAINER2>&);
106
107 template <class VALUE2, class CONTAINER2>
108 friend bool operator>=(const queue<VALUE2, CONTAINER2>&,
109 const queue<VALUE2, CONTAINER2>&);
110
111#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
112 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
113 template <class VALUE2, three_way_comparable CONTAINER2>
114 friend compare_three_way_result_t<CONTAINER2>
115 operator<=>(const queue<VALUE2, CONTAINER2>&,
116 const queue<VALUE2, CONTAINER2>&);
117#endif
118
119 // PRIVATE TYPES
120
121 /// This `typedef` is a convenient alias for the utility associated with
122 /// movable references.
123 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
124
125 // PRIVATE MANIPULATORS
126
127 /// Push onto the back of this queue the elements of the specified
128 /// `[first, last)` range.
129 template <class INPUT_ITER, class SENTINEL>
130 void privatePushRange(INPUT_ITER first, SENTINEL last);
131
132 public:
133 // PUBLIC TYPES
134 typedef typename CONTAINER::value_type value_type;
135 typedef typename CONTAINER::reference reference;
136 typedef typename CONTAINER::const_reference const_reference;
137 typedef typename CONTAINER::size_type size_type;
138 typedef CONTAINER container_type;
139
140 protected:
141 // PROTECTED DATA
142 CONTAINER c; // Contains the elements of this queue.
143 // 'protected' and named ('c') per the C++11 standard.
144
145 public:
146 // TRAITS
148 queue,
149 BloombergLP::bslma::UsesBslmaAllocator,
150 BloombergLP::bslma::UsesBslmaAllocator<container_type>::value);
151
152 // CREATORS
153
154 /// Create an empty queue having a container of the parameterized
155 /// `CONTAINER` type.
156 explicit queue();
157
158 /// Create a queue having the value of the specified `original`.
159 queue(const queue& original);
160
161 /// Create a queue having the value of the specified `original`. The
162 /// allocator associated with `original` (if any) is propagated for use
163 /// in the new queue. `original` is left in valid but unspecified
164 /// state.
165 queue(BloombergLP::bslmf::MovableRef<queue> container);
166
167 /// Create a queue having the specified `container` that holds elements
168 /// of the parameterized `VALUE` type.
169 explicit queue(const CONTAINER& container);
170
171 /// Create a queue having the same sequence of values as the specified
172 /// `container`. The allocator associated with `container` (if any) is
173 /// propagated for use in the new queue. `container` is left in valid
174 /// but unspecified state.
175 explicit queue(BloombergLP::bslmf::MovableRef<CONTAINER> container);
176
177 /// Create an empty queue. This queue object uses the specified `basicAllocator` to supply memory.
178 ///
179 /// \note Note that the `ALLOCATOR`
180 /// parameter type has to be convertible to the allocator of the
181 /// `CONTAINER` parameter type, `CONTAINER::allocator_type`; otherwise,
182 /// this constructor is disabled.
183 template <class ALLOCATOR>
184 explicit
185 queue(const ALLOCATOR& basicAllocator,
187 ALLOCATOR>::type * = 0);
188
189 /// Create a queue having the same sequence of values as the specified
190 /// `container`. The queue object uses the specified `basicAllocator` to obtain memory.
191 ///
192 /// \note Note that the `ALLOCATOR` parameter type has to
193 /// be convertible to the allocator of the `CONTAINER` parameter type,
194 /// `CONTAINER::allocator_type`; otherwise, this constructor is
195 /// disabled.
196 template <class ALLOCATOR>
197 queue(const CONTAINER& container,
198 const ALLOCATOR& basicAllocator,
200 ALLOCATOR>::type * = 0);
201
202 /// Create a queue having the value of the specified `original` that
203 /// will use the specified `basicAllocator` to supply memory.
204 ///
205 /// \note Note that the `ALLOCATOR` parameter type has to be convertible to the
206 /// allocator of the `CONTAINER` parameter type,
207 /// `CONTAINER::allocator_type`. Otherwise this constructor is
208 /// disabled.
209 template <class ALLOCATOR>
210 queue(const queue& original,
211 const ALLOCATOR& basicAllocator,
213 ALLOCATOR>::type * = 0);
214
215 /// Create a queue whose underlying container has the value of the
216 /// specified `container` (on entry) and uses `basicAllocator` to supply
217 /// memory. The allocated-extended move constructor of `CONTAINER` is
218 /// used to create the new queue. `container` is left in a valid but unspecified state.
219 ///
220 /// \note Note that a `bslma::Allocator *` can be supplied
221 /// for `basicAllocator` if the (template parameter) `ALLOCATOR` is
222 /// `bsl::allocator` (the default). Also note that this method assumes
223 /// that `CONTAINER` has a move constructor. Also note that if
224 /// `CONTAINER::allocator_type` does not exist, this constructor is
225 /// disabled.
226 template <class ALLOCATOR>
227 queue(BloombergLP::bslmf::MovableRef<CONTAINER> container,
228 const ALLOCATOR& basicAllocator,
230 ALLOCATOR>::type * = 0);
231
232 /// Create a queue having the value of the specified `original` (on
233 /// entry), that uses `basicAllocator` to supply memory. The
234 /// allocator-extended move constructor of `CONTAINER` is used to create
235 /// the new queue. `original` is left in a valid but unspecified state.
236 ///
237 /// \note Note that a `bslma::Allocator *` can be supplied for
238 /// `basicAllocator` if the (template parameter) `ALLOCATOR` is
239 /// `bsl::allocator` (the default). Also note that this method assumes
240 /// that `CONTAINER` has a move constructor. Also note that if
241 /// `CONTAINER::allocator_type` does not exist, this constructor is
242 /// disabled.
243 template <class ALLOCATOR>
244 queue(BloombergLP::bslmf::MovableRef<queue> original,
245 const ALLOCATOR& basicAllocator,
247 ALLOCATOR>::type * = 0);
248
249 /// Create a queue passing the specified `first` and `last` to the
250 /// constructor of the underlying container. Optionally specify an
251 /// `allocator` used to supply memory. If `allocator` is not specified, a
252 /// default-constructed object of the (template parameter) type `ALLOCATOR`
253 /// is used.
254 template <class INPUT_ITER>
255 queue(INPUT_ITER first, INPUT_ITER last);
256 template <class INPUT_ITER, class ALLOCATOR>
257 queue(INPUT_ITER first,
258 INPUT_ITER last,
259 const ALLOCATOR& allocator,
261 ALLOCATOR>::type * = 0);
262
263 /// Create a queue from the elements of the specifed `range`. Optionally
264 /// specify an `allocator` used to supply memory. If `allocator` is not
265 /// specified, a default-constructed object of the (template parameter) type `t_ALLOCATOR` is used.
266 ///
267 /// \note Note that `range` must meet the
268 /// requirements of an input range and the values from `range` must have a
269 /// type matching or convertible to (template parameter) `VALUE`.
270 template <class t_RANGE>
272 queue(from_range_t, BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range);
273 template <class t_RANGE, class t_ALLOCATOR>
275 queue(from_range_t ,
277 const t_ALLOCATOR& allocator,
279 t_ALLOCATOR>::type * = 0);
280
281 // MANIPULATORS
282
283 /// Assign to this queue the value of the specified `rhs`, and return a
284 /// reference providing modifiable access to this queue.
285 queue& operator=(const queue& rhs);
286
287 /// Assign to this queue the value as the specified `rhs` and return a
288 /// reference providing modifiable access to this queue. The
289 /// move-assignment operator of `CONTAINER` is used to set the value of
290 /// this queue. `rhs` is left in a valid but unspecified state, and if
291 /// an exception is thrown, `*this` is left in a valid but unspecified
292 /// state.
293 queue& operator=(BloombergLP::bslmf::MovableRef<queue> rhs);
294
295#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
296// {{{ BEGIN GENERATED CODE
297// Command line: sim_cpp11_features.pl bslstl_queue.h
298#ifndef BSLSTL_QUEUE_VARIADIC_LIMIT
299#define BSLSTL_QUEUE_VARIADIC_LIMIT 10
300#endif
301#ifndef BSLSTL_QUEUE_VARIADIC_LIMIT_A
302#define BSLSTL_QUEUE_VARIADIC_LIMIT_A BSLSTL_QUEUE_VARIADIC_LIMIT
303#endif
304#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 0
306#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 0
307
308#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 1
309 template <class Args_01>
311#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 1
312
313#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 2
314 template <class Args_01,
315 class Args_02>
317 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
318#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 2
319
320#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 3
321 template <class Args_01,
322 class Args_02,
323 class Args_03>
325 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
326 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
327#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 3
328
329#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 4
330 template <class Args_01,
331 class Args_02,
332 class Args_03,
333 class Args_04>
335 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
336 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
337 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
338#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 4
339
340#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 5
341 template <class Args_01,
342 class Args_02,
343 class Args_03,
344 class Args_04,
345 class Args_05>
347 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
348 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
349 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
350 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
351#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 5
352
353#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 6
354 template <class Args_01,
355 class Args_02,
356 class Args_03,
357 class Args_04,
358 class Args_05,
359 class Args_06>
361 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
362 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
363 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
364 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
365 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
366#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 6
367
368#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 7
369 template <class Args_01,
370 class Args_02,
371 class Args_03,
372 class Args_04,
373 class Args_05,
374 class Args_06,
375 class Args_07>
377 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
378 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
379 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
380 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
381 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
382 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
383#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 7
384
385#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 8
386 template <class Args_01,
387 class Args_02,
388 class Args_03,
389 class Args_04,
390 class Args_05,
391 class Args_06,
392 class Args_07,
393 class Args_08>
395 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
396 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
397 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
398 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
399 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
400 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
401 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
402#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 8
403
404#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 9
405 template <class Args_01,
406 class Args_02,
407 class Args_03,
408 class Args_04,
409 class Args_05,
410 class Args_06,
411 class Args_07,
412 class Args_08,
413 class Args_09>
415 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
416 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
417 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
418 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
419 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
420 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
421 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
422 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
423#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 9
424
425#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 10
426 template <class Args_01,
427 class Args_02,
428 class Args_03,
429 class Args_04,
430 class Args_05,
431 class Args_06,
432 class Args_07,
433 class Args_08,
434 class Args_09,
435 class Args_10>
437 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
438 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
439 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
440 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
441 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
442 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
443 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
444 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
445 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
446#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 10
447
448#else
449// The generated code below is a workaround for the absence of perfect
450// forwarding in some compilers.
451 template <class... Args>
453// }}} END GENERATED CODE
454#endif
455
456 /// Push onto the back of this queue a `value_type` object having the
457 /// specified `value`.
458 void push(const value_type& value);
459
460 /// Push onto the back of this queue a `value_type` object having the
461 /// value of the specified `value` (on entry) by moving the
462 /// contents of `value` to the new object on this queue. `value` is
463 /// left in a valid but unspecified state.
464 void push(BloombergLP::bslmf::MovableRef<value_type> value);
465
466 /// Push onto the back of this queue the elements of the specified `range`.
467 ///
468 /// \note Note that `range` must meet the requirements of an input range and the
469 /// values from `range` must have a type matching or convertible to
470 /// (template parameter) `VALUE`.
471 template <class t_RANGE>
474
475 /// Remove the front (the earliest pushed) element from this `queue`
476 /// object.
477 void pop();
478
479 /// Efficiently exchange the value of this object with the value of the
480 /// specified `other` object. In effect, performs
481 /// `using bsl::swap; swap(c, other.c);`.
483 bsl::is_nothrow_swappable<CONTAINER>::value);
484
485 /// Return a reference providing modifiable access to the front (the
486 /// earliest pushed) element from this `queue` object.
488
489 /// Return a reference providing modifiable access to the back (the
490 /// latest pushed) element of this `queue` object.
491 reference back();
492
493 // ACCESSORS
494
495 /// Return `true` if this `queue` object contains no elements, and
496 /// `false` otherwise. In effect, performs `return c.empty();`.
497 bool empty() const;
498
499 /// Return the number of elements in this queue. In effect, performs
500 /// `return c.size();`.
501 size_type size() const;
502
503 /// Return the immutable front (the earliest pushed) element from this
504 /// `queue` object. In effect, performs `c.front()`.
505 const_reference front() const;
506
507 /// Return the immutable back (the latest pushed) element from this
508 /// `queue` object. In effect, performs `c.back()`.
509 const_reference back() const;
510};
511
512#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
513// CLASS TEMPLATE DEDUCTION GUIDES
514
515/// Deduce the template parameters `VALUE` and `CONTAINER` from the
516/// parameters supplied to the constructor of `queue`. This deduction guide
517/// does not participate if the parameter meets the requirements for a
518/// standard allocator.
519template<class CONTAINER,
520 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<CONTAINER>>
521 >
522queue(CONTAINER) -> queue<typename CONTAINER::value_type, CONTAINER>;
523
524/// Deduce the template parameters `VALUE` and `CONTAINER` from the
525/// parameters supplied to the constructor of `queue`. This deduction
526/// guide does not participate unless the supplied allocator is convertible
527/// to the underlying container's `allocator_type`.
528template<
529 class CONTAINER,
530 class ALLOCATOR,
531 class = bsl::enable_if_t<bsl::uses_allocator_v<CONTAINER, ALLOCATOR>>
532 >
533queue(CONTAINER, ALLOCATOR) -> queue<typename CONTAINER::value_type, CONTAINER>;
534
535/// Deduce the template parameter `VALUE` from the parameters supplied to the
536/// constructor of `queue`.
537template <class INPUT_ITER,
538 class TYPE = BloombergLP::bslstl::IteratorUtil::
539 IterVal_t<INPUT_ITER>>
540queue(INPUT_ITER, INPUT_ITER) -> queue<TYPE>;
541
542/// Deduce the template parameters `VALUE` and `CONTAINER` from the parameters
543/// supplied to the constructor of `queue`. This deduction guide does not
544/// participate unless the `ALLOCATOR` parameter meets the requirements for a
545/// standard allocator.
546template <class INPUT_ITER,
547 class ALLOCATOR,
548 class TYPE = BloombergLP::bslstl::IteratorUtil::
549 IterVal_t<INPUT_ITER>,
550 class = enable_if_t<IsStdAllocator_v<ALLOCATOR>>>
551queue(INPUT_ITER, INPUT_ITER, ALLOCATOR)-> queue<TYPE, deque<TYPE, ALLOCATOR>>;
552
553#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
554 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
555/// Deduce the template parameter `VALUE` from the parameters supplied to the
556/// constructor of `queue`.
557template <ranges::input_range t_RANGE>
558queue(from_range_t, t_RANGE&&) -> queue<ranges::range_value_t<t_RANGE>>;
559
560/// Deduce the template parameters `VALUE` and `ALLOCATOR` from the parameters
561/// supplied to the constructor of `queue`. This deduction guide does not
562/// participate unless the `t_ALLOCATOR` parameter meets the requirements for a
563/// standard allocator.
564template <ranges::input_range t_RANGE,
565 class t_ALLOCATOR,
566 class t_TYPE = ranges::range_value_t<t_RANGE>>
567requires IsStdAllocator_v<t_ALLOCATOR>
568queue(from_range_t, t_RANGE&&, t_ALLOCATOR)
569-> queue<t_TYPE, deque<t_TYPE, t_ALLOCATOR>>;
570#endif
571#endif
572
573// FREE OPERATORS
574
575/// Return `true` if the specified `lhs` and `rhs` objects have the same
576/// value, and `false` otherwise. Two `queue` objects `lhs` and `rhs` have
577/// the same value if they have the same number of elements, and each
578/// element in the ordered sequence of elements of `lhs` has the same value
579/// as the corresponding element in the ordered sequence of elements of
580/// `rhs`. This method requires that the (template parameter) type `VALUE`
581/// be `equality-comparable` (see {Requirements on `VALUE`}).
582template <class VALUE, class CONTAINER>
583bool operator==(const queue<VALUE, CONTAINER>& lhs,
584 const queue<VALUE, CONTAINER>& rhs);
585
586/// Return `true` if the specified `lhs` and `rhs` objects do not have the
587/// same value, and `false` otherwise. Two `queue` objects `lhs` and `rhs`
588/// do not have the same value if they do not have the same number of
589/// elements, or some element in the ordered sequence of elements of `lhs`
590/// does not have the same value as the corresponding element in the ordered
591/// sequence of elements of `rhs`. This method requires that the (template
592/// parameter) type `VALUE` be `equality-comparable` (see {Requirements on
593/// `VALUE`}).
594template <class VALUE, class CONTAINER>
595bool operator!=(const queue<VALUE, CONTAINER>& lhs,
596 const queue<VALUE, CONTAINER>& rhs);
597
598/// Return `true` if the value of the specified `lhs` queue is
599/// lexicographically less than that of the specified `rhs` queue, and
600/// `false` otherwise. Given iterators `i` and `j` over the respective
601/// sequences `[lhs.begin() .. lhs.end())` and `[rhs.begin() .. rhs.end())`,
602/// the value of queue `lhs` is lexicographically less than that of queue
603/// `rhs` if `true == *i < *j` for the first pair of corresponding iterator
604/// positions where `*i < *j` and `*j < *i` are not both `false`. If no
605/// such corresponding iterator position exists, the value of `lhs` is
606/// lexicographically less than that of `rhs` if `lhs.size() < rhs.size()`.
607/// This method requires that `operator<`, inducing a total order, be
608/// defined for `value_type`.
609template <class VALUE, class CONTAINER>
610bool operator< (const queue<VALUE, CONTAINER>& lhs,
611 const queue<VALUE, CONTAINER>& rhs);
612
613/// Return `true` if the value of the specified `lhs` queue is
614/// lexicographically greater than that of the specified `rhs` queue, and
615/// `false` otherwise. The value of queue `lhs` is lexicographically
616/// greater than that of queue `rhs` if `rhs` is lexicographically less than
617/// `lhs` (see `operator<`). This method requires that `operator<`, inducing a total order, be defined for `value_type`.
618///
619/// \note Note that this
620/// operator returns `rhs < lhs`.
621template <class VALUE, class CONTAINER>
622bool operator> (const queue<VALUE, CONTAINER>& lhs,
623 const queue<VALUE, CONTAINER>& rhs);
624
625/// Return `true` if the value of the specified `lhs` queue is
626/// lexicographically less than or equal to that of the specified `rhs`
627/// queue, and `false` otherwise. The value of queue `lhs` is
628/// lexicographically less than or equal to that of queue `rhs` if `rhs` is
629/// not lexicographically less than `lhs` (see `operator<`). This method
630/// requires that `operator<`, inducing a total order, be defined for `value_type`.
631///
632/// \note Note that this operator returns `!(rhs < lhs)`.
633template <class VALUE, class CONTAINER>
634bool operator<=(const queue<VALUE, CONTAINER>& lhs,
635 const queue<VALUE, CONTAINER>& rhs);
636
637/// Return `true` if the value of the specified `lhs` queue is
638/// lexicographically greater than or equal to that of the specified `rhs`
639/// queue, and `false` otherwise. The value of queue `lhs` is
640/// lexicographically greater than or equal to that of queue `rhs` if `lhs`
641/// is not lexicographically less than `rhs` (see `operator<`). This method
642/// requires that `operator<`, inducing a total order, be defined for `value_type`.
643///
644/// \note Note that this operator returns `!(lhs < rhs)`.
645template <class VALUE, class CONTAINER>
646bool operator>=(const queue<VALUE, CONTAINER>& lhs,
647 const queue<VALUE, CONTAINER>& rhs);
648
649// FREE FUNCTIONS
650
651/// Swap the value of the specified `lhs` queue with the value of the
652/// specified `rhs` queue.
653template <class VALUE, class CONTAINER>
654void swap(queue<VALUE, CONTAINER>& lhs,
655 queue<VALUE, CONTAINER>& rhs)
657
658// ============================================================================
659// TEMPLATE AND INLINE FUNCTION DEFINITIONS
660// ============================================================================
661
662 // -----------
663 // class queue
664 // -----------
665
666// CREATORS
667template <class VALUE, class CONTAINER>
668inline
670{
671}
672
673template <class VALUE, class CONTAINER>
674inline
675queue<VALUE, CONTAINER>::queue(const queue& original)
676: c(original.c)
677{
678}
679
680template <class VALUE, class CONTAINER>
681inline
682queue<VALUE, CONTAINER>::queue(BloombergLP::bslmf::MovableRef<queue> original)
683: c(MoveUtil::move(MoveUtil::access(original).c))
684{
685}
686
687template <class VALUE, class CONTAINER>
688inline
689queue<VALUE, CONTAINER>::queue(const CONTAINER& container)
690: c(container)
691{
692}
693
694template <class VALUE, class CONTAINER>
695template <class ALLOCATOR>
696inline
697queue<VALUE, CONTAINER>::queue(
698 const ALLOCATOR& basicAllocator,
700 ALLOCATOR>::type *)
701: c(basicAllocator)
702{
703}
704
705template <class VALUE, class CONTAINER>
706template <class ALLOCATOR>
707inline
708queue<VALUE, CONTAINER>::queue(
709 const CONTAINER& container,
710 const ALLOCATOR& basicAllocator,
712 ALLOCATOR>::type *)
713: c(container, basicAllocator)
714{
715}
716
717template <class VALUE, class CONTAINER>
718template <class ALLOCATOR>
719inline
720queue<VALUE, CONTAINER>::queue(
721 const queue& queue,
722 const ALLOCATOR& basicAllocator,
724 ALLOCATOR>::type *)
725: c(queue.c, basicAllocator)
726{
727}
728
729template <class VALUE, class CONTAINER>
730inline
731queue<VALUE, CONTAINER>::queue(BloombergLP::bslmf::MovableRef<CONTAINER>
732 container)
733: c(MoveUtil::move(container))
734{
735}
736
737template <class VALUE, class CONTAINER>
738template <class ALLOCATOR>
739inline
740queue<VALUE, CONTAINER>::queue(
741 BloombergLP::bslmf::MovableRef<CONTAINER> container,
742 const ALLOCATOR& basicAllocator,
744 ALLOCATOR>::type *)
745: c(MoveUtil::move(container), basicAllocator)
746{
747}
748
749template <class VALUE, class CONTAINER>
750template <class ALLOCATOR>
751inline
752queue<VALUE, CONTAINER>::queue(
753 BloombergLP::bslmf::MovableRef<queue> original,
754 const ALLOCATOR& basicAllocator,
756 ALLOCATOR>::type *)
757: c(MoveUtil::move(MoveUtil::access(original).c), basicAllocator)
758{
759}
760
761template <class VALUE, class CONTAINER>
762template <class INPUT_ITER>
763inline
764queue<VALUE, CONTAINER>::queue(INPUT_ITER first, INPUT_ITER last)
765: c(first, last)
766{
767}
768
769template <class VALUE, class CONTAINER>
770template <class INPUT_ITER, class ALLOCATOR>
771inline
772queue<VALUE, CONTAINER>::queue(
773 INPUT_ITER first,
774 INPUT_ITER last,
775 const ALLOCATOR& allocator,
777 ALLOCATOR>::type *)
778: c(first, last, allocator)
779{
780}
781
782template <class VALUE, class CONTAINER>
783template <class t_RANGE>
785inline
786queue<VALUE, CONTAINER>::queue(
787 from_range_t ,
789#ifdef BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_TO_CONTAINER
790: c(ranges::to<CONTAINER>(std::forward<t_RANGE>(range)))
791#else
793#endif
794{
795}
796
797template <class VALUE, class CONTAINER>
798template <class t_RANGE, class t_ALLOCATOR>
800inline
801queue<VALUE, CONTAINER>::queue(
802 from_range_t ,
804 const t_ALLOCATOR& allocator,
805 typename enable_if<
807 t_ALLOCATOR>::type *)
808#ifdef BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_TO_CONTAINER
809: c(ranges::to<CONTAINER>(std::forward<t_RANGE>(range), allocator))
810#else
811: c(bsl::from_range, BSLS_COMPILERFEATURES_FORWARD(t_RANGE, range), allocator)
812#endif
813{
814}
815
816// PRIVATE MANIPULATORS
817template <class VALUE, class CONTAINER>
818template <class INPUT_ITER, class SENTINEL>
819inline
820void queue<VALUE, CONTAINER>::privatePushRange(INPUT_ITER first,
821 SENTINEL last)
822{
823 while (first != last) {
824 push(*first);
825 ++first;
826 }
827}
828
829// MANIPULATORS
830template <class VALUE, class CONTAINER>
831inline
832queue<VALUE, CONTAINER>& queue<VALUE, CONTAINER>::operator=(const queue& rhs)
833{
834 c = rhs.c;
835 return *this;
836}
837
838template <class VALUE, class CONTAINER>
839inline
840queue<VALUE, CONTAINER>& queue<VALUE, CONTAINER>::operator=(
841 BloombergLP::bslmf::MovableRef<queue> rhs)
842{
843 c = MoveUtil::move(MoveUtil::access(rhs).c);
844 return *this;
845}
846
847#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
848// {{{ BEGIN GENERATED CODE
849// Command line: sim_cpp11_features.pl bslstl_queue.h
850#ifndef BSLSTL_QUEUE_VARIADIC_LIMIT
851#define BSLSTL_QUEUE_VARIADIC_LIMIT 10
852#endif
853#ifndef BSLSTL_QUEUE_VARIADIC_LIMIT_B
854#define BSLSTL_QUEUE_VARIADIC_LIMIT_B BSLSTL_QUEUE_VARIADIC_LIMIT
855#endif
856#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 0
857template <class VALUE, class CONTAINER>
858inline
859typename queue<VALUE, CONTAINER>::reference
860queue<VALUE, CONTAINER>::emplace(
861 )
862{
863 c.emplace_back();
864 return back();
865}
866#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 0
867
868#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 1
869template <class VALUE, class CONTAINER>
870template <class Args_01>
871inline
872typename queue<VALUE, CONTAINER>::reference
873queue<VALUE, CONTAINER>::emplace(
874 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
875{
876 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01));
877 return back();
878}
879#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 1
880
881#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 2
882template <class VALUE, class CONTAINER>
883template <class Args_01,
884 class Args_02>
885inline
886typename queue<VALUE, CONTAINER>::reference
887queue<VALUE, CONTAINER>::emplace(
888 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
889 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
890{
891 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
892 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02));
893 return back();
894}
895#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 2
896
897#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 3
898template <class VALUE, class CONTAINER>
899template <class Args_01,
900 class Args_02,
901 class Args_03>
902inline
903typename queue<VALUE, CONTAINER>::reference
904queue<VALUE, CONTAINER>::emplace(
905 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
906 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
907 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
908{
909 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
910 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
911 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03));
912 return back();
913}
914#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 3
915
916#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 4
917template <class VALUE, class CONTAINER>
918template <class Args_01,
919 class Args_02,
920 class Args_03,
921 class Args_04>
922inline
923typename queue<VALUE, CONTAINER>::reference
924queue<VALUE, CONTAINER>::emplace(
925 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
926 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
927 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
928 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
929{
930 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
931 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
932 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
933 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04));
934 return back();
935}
936#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 4
937
938#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 5
939template <class VALUE, class CONTAINER>
940template <class Args_01,
941 class Args_02,
942 class Args_03,
943 class Args_04,
944 class Args_05>
945inline
946typename queue<VALUE, CONTAINER>::reference
947queue<VALUE, CONTAINER>::emplace(
948 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
949 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
950 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
951 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
952 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
953{
954 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
955 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
956 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
957 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
958 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05));
959 return back();
960}
961#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 5
962
963#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 6
964template <class VALUE, class CONTAINER>
965template <class Args_01,
966 class Args_02,
967 class Args_03,
968 class Args_04,
969 class Args_05,
970 class Args_06>
971inline
972typename queue<VALUE, CONTAINER>::reference
973queue<VALUE, CONTAINER>::emplace(
974 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
975 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
976 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
977 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
978 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
979 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
980{
981 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
982 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
983 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
984 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
985 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05),
986 BSLS_COMPILERFEATURES_FORWARD(Args_06,args_06));
987 return back();
988}
989#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 6
990
991#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 7
992template <class VALUE, class CONTAINER>
993template <class Args_01,
994 class Args_02,
995 class Args_03,
996 class Args_04,
997 class Args_05,
998 class Args_06,
999 class Args_07>
1000inline
1001typename queue<VALUE, CONTAINER>::reference
1002queue<VALUE, CONTAINER>::emplace(
1003 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1004 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1005 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1006 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1007 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1008 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1009 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
1010{
1011 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
1012 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
1013 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
1014 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
1015 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05),
1016 BSLS_COMPILERFEATURES_FORWARD(Args_06,args_06),
1017 BSLS_COMPILERFEATURES_FORWARD(Args_07,args_07));
1018 return back();
1019}
1020#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 7
1021
1022#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 8
1023template <class VALUE, class CONTAINER>
1024template <class Args_01,
1025 class Args_02,
1026 class Args_03,
1027 class Args_04,
1028 class Args_05,
1029 class Args_06,
1030 class Args_07,
1031 class Args_08>
1032inline
1033typename queue<VALUE, CONTAINER>::reference
1034queue<VALUE, CONTAINER>::emplace(
1035 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1036 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1037 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1038 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1039 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1040 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1041 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1042 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
1043{
1044 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
1045 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
1046 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
1047 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
1048 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05),
1049 BSLS_COMPILERFEATURES_FORWARD(Args_06,args_06),
1050 BSLS_COMPILERFEATURES_FORWARD(Args_07,args_07),
1051 BSLS_COMPILERFEATURES_FORWARD(Args_08,args_08));
1052 return back();
1053}
1054#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 8
1055
1056#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 9
1057template <class VALUE, class CONTAINER>
1058template <class Args_01,
1059 class Args_02,
1060 class Args_03,
1061 class Args_04,
1062 class Args_05,
1063 class Args_06,
1064 class Args_07,
1065 class Args_08,
1066 class Args_09>
1067inline
1068typename queue<VALUE, CONTAINER>::reference
1069queue<VALUE, CONTAINER>::emplace(
1070 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1071 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1072 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1073 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1074 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1075 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1076 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1077 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1078 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
1079{
1080 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
1081 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
1082 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
1083 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
1084 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05),
1085 BSLS_COMPILERFEATURES_FORWARD(Args_06,args_06),
1086 BSLS_COMPILERFEATURES_FORWARD(Args_07,args_07),
1087 BSLS_COMPILERFEATURES_FORWARD(Args_08,args_08),
1088 BSLS_COMPILERFEATURES_FORWARD(Args_09,args_09));
1089 return back();
1090}
1091#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 9
1092
1093#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 10
1094template <class VALUE, class CONTAINER>
1095template <class Args_01,
1096 class Args_02,
1097 class Args_03,
1098 class Args_04,
1099 class Args_05,
1100 class Args_06,
1101 class Args_07,
1102 class Args_08,
1103 class Args_09,
1104 class Args_10>
1105inline
1106typename queue<VALUE, CONTAINER>::reference
1107queue<VALUE, CONTAINER>::emplace(
1108 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1109 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1110 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1111 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1112 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1113 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1114 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1115 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1116 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
1117 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
1118{
1119 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
1120 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
1121 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
1122 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
1123 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05),
1124 BSLS_COMPILERFEATURES_FORWARD(Args_06,args_06),
1125 BSLS_COMPILERFEATURES_FORWARD(Args_07,args_07),
1126 BSLS_COMPILERFEATURES_FORWARD(Args_08,args_08),
1127 BSLS_COMPILERFEATURES_FORWARD(Args_09,args_09),
1128 BSLS_COMPILERFEATURES_FORWARD(Args_10,args_10));
1129 return back();
1130}
1131#endif // BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 10
1132
1133#else
1134// The generated code below is a workaround for the absence of perfect
1135// forwarding in some compilers.
1136template <class VALUE, class CONTAINER>
1137template <class... Args>
1138inline
1139typename queue<VALUE, CONTAINER>::reference
1140queue<VALUE, CONTAINER>::emplace(
1142{
1143 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args,args)...);
1144 return back();
1145}
1146// }}} END GENERATED CODE
1147#endif
1148
1149template <class VALUE, class CONTAINER>
1150inline
1151void queue<VALUE, CONTAINER>::push(const value_type& value)
1152{
1153 c.push_back(value);
1154}
1155
1156template <class VALUE, class CONTAINER>
1157inline
1158void queue<VALUE, CONTAINER>::push(BloombergLP::bslmf::MovableRef<value_type>
1159 value)
1160{
1161 c.push_back(MoveUtil::move(value));
1162}
1163
1164template <class VALUE, class CONTAINER>
1165template <class t_RANGE>
1167void queue<VALUE, CONTAINER>::push_range(
1168 BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range)
1169{
1170#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
1171 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
1172 if constexpr (requires{ c.append_range(std::forward<t_RANGE>(range)); }) {
1173 c.append_range(std::forward<t_RANGE>(range));
1174 }
1175 else {
1176 ranges::copy(range, back_inserter(c));
1177 }
1178#else
1179 privatePushRange(bsl::begin(range), bsl::end(range));
1180#endif
1181}
1182
1183template <class VALUE, class CONTAINER>
1184inline
1185void queue<VALUE, CONTAINER>::pop()
1186{
1187 c.pop_front();
1188}
1189
1190template <class VALUE, class CONTAINER>
1191inline
1192void queue<VALUE, CONTAINER>::swap(queue& other)
1194 bsl::is_nothrow_swappable<CONTAINER>::value)
1195{
1196 BloombergLP::bslalg::SwapUtil::swap(&c, &other.c);
1197}
1198
1199// ACCESSORS
1200template <class VALUE, class CONTAINER>
1201inline
1202bool queue<VALUE, CONTAINER>::empty() const
1203{
1204 return c.empty();
1205}
1206
1207template <class VALUE, class CONTAINER>
1208inline
1209typename queue<VALUE, CONTAINER>::size_type
1210queue<VALUE, CONTAINER>::size() const
1211{
1212 return c.size();
1213}
1214
1215template <class VALUE, class CONTAINER>
1216inline
1217typename queue<VALUE, CONTAINER>::reference
1218queue<VALUE, CONTAINER>::front()
1219{
1220 return c.front();
1221}
1222
1223template <class VALUE, class CONTAINER>
1224inline
1225typename queue<VALUE, CONTAINER>::const_reference
1226queue<VALUE, CONTAINER>::front() const
1227{
1228 return c.front();
1229}
1230
1231template <class VALUE, class CONTAINER>
1232inline
1233typename queue<VALUE, CONTAINER>::reference
1234queue<VALUE, CONTAINER>::back()
1235{
1236 return c.back();
1237}
1238
1239template <class VALUE, class CONTAINER>
1240inline
1241typename queue<VALUE, CONTAINER>::const_reference
1242queue<VALUE, CONTAINER>::back() const
1243{
1244 return c.back();
1245}
1246
1247// FREE OPERATORS
1248template <class VALUE, class CONTAINER>
1249inline
1250bool operator==(const queue<VALUE, CONTAINER>& lhs,
1251 const queue<VALUE, CONTAINER>& rhs)
1252{
1253 return lhs.c == rhs.c;
1254}
1255
1256template <class VALUE, class CONTAINER>
1257inline
1258bool operator!=(const queue<VALUE, CONTAINER>& lhs,
1259 const queue<VALUE, CONTAINER>& rhs)
1260{
1261 return lhs.c != rhs.c;
1262}
1263
1264template <class VALUE, class CONTAINER>
1265inline
1266bool operator< (const queue<VALUE, CONTAINER>& lhs,
1267 const queue<VALUE, CONTAINER>& rhs)
1268{
1269 return lhs.c < rhs.c;
1270}
1271
1272template <class VALUE, class CONTAINER>
1273inline
1274bool operator> (const queue<VALUE, CONTAINER>& lhs,
1275 const queue<VALUE, CONTAINER>& rhs)
1276{
1277 return lhs.c > rhs.c;
1278}
1279
1280template <class VALUE, class CONTAINER>
1281inline
1282bool operator<=(const queue<VALUE, CONTAINER>& lhs,
1283 const queue<VALUE, CONTAINER>& rhs)
1284{
1285 return lhs.c <= rhs.c;
1286}
1287
1288template <class VALUE, class CONTAINER>
1289inline
1290bool operator>=(const queue<VALUE, CONTAINER>& lhs,
1291 const queue<VALUE, CONTAINER>& rhs)
1292{
1293 return lhs.c >= rhs.c;
1294}
1295
1296#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
1297 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1298template <class VALUE, three_way_comparable CONTAINER>
1299inline compare_three_way_result_t<CONTAINER>
1300operator<=>(const queue<VALUE, CONTAINER>& lhs,
1301 const queue<VALUE, CONTAINER>& rhs)
1302{
1303 return lhs.c <=> rhs.c;
1304}
1305#endif
1306
1307// FREE FUNCTIONS
1308template <class VALUE, class CONTAINER>
1309inline
1310void swap(queue<VALUE, CONTAINER>& lhs,
1311 queue<VALUE, CONTAINER>& rhs)
1313{
1314 lhs.swap(rhs);
1315}
1316
1317} // close namespace bsl
1318
1319#else // if ! defined(DEFINED_BSLSTL_QUEUE_H)
1320# error Not valid except when included from bslstl_queue.h
1321#endif // ! defined(COMPILING_BSLSTL_QUEUE_H)
1322
1323#endif // ! defined(INCLUDED_BSLSTL_QUEUE_CPP03)
1324
1325// ----------------------------------------------------------------------------
1326// Copyright 2016 Bloomberg Finance L.P.
1327//
1328// Licensed under the Apache License, Version 2.0 (the "License");
1329// you may not use this file except in compliance with the License.
1330// You may obtain a copy of the License at
1331//
1332// http://www.apache.org/licenses/LICENSE-2.0
1333//
1334// Unless required by applicable law or agreed to in writing, software
1335// distributed under the License is distributed on an "AS IS" BASIS,
1336// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1337// See the License for the specific language governing permissions and
1338// limitations under the License.
1339// ----------------------------- END-OF-FILE ----------------------------------
1340
1341/** @} */
1342/** @} */
1343/** @} */
#define BSLMF_NESTED_TRAIT_DECLARATION_IF(t_TYPE, t_TRAIT, t_COND)
Definition bslmf_nestedtraitdeclaration.h:243
friend bool operator==(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
void pop()
Definition bslstl_queue.h:989
CONTAINER::const_reference const_reference
Definition bslstl_queue.h:381
size_type size() const
Definition bslstl_queue.h:1014
friend bool operator<=(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
queue()
Definition bslstl_queue.h:763
bool empty() const
Definition bslstl_queue.h:1006
friend bool operator>=(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
friend bool operator!=(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
CONTAINER::value_type value_type
Definition bslstl_queue.h:379
void push_range(BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range)
Definition bslstl_queue.h:971
void push(const value_type &value)
Definition bslstl_queue.h:955
CONTAINER::size_type size_type
Definition bslstl_queue.h:382
queue & operator=(const queue &rhs)
Definition bslstl_queue.h:926
void swap(queue &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl reference front()
Definition bslstl_queue.h:581
reference back()
Definition bslstl_queue.h:1038
CONTAINER container_type
Definition bslstl_queue.h:383
CONTAINER::reference reference
Definition bslstl_queue.h:380
friend bool operator<(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
friend bool operator>(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
reference emplace(Args &&... args)
Definition bslstl_queue.h:946
CONTAINER c
Definition bslstl_queue.h:387
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:231
static const t_TYPE value
Definition bslmf_integralconstant.h:267
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2343
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2349
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:676
#define BSLSTL_QUEUE_REQUIRES_CONTAINER_COMPATIBLE_RANGE(R, T)
Definition bslstl_queue.h:294
bool operator!=(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
bool operator==(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
void swap(OptionValue &a, OptionValue &b)
bool operator>=(const Guid &lhs, const Guid &rhs)
bool operator<=(const Guid &lhs, const Guid &rhs)
Definition bdlat_valuetypefunctions.h:939
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
T::iterator begin(T &container)
Definition bslstl_iterator.h:1593
const from_range_t from_range
ALLOCATOR & lhs
Definition bslstl_string.h:3917
T::iterator end(T &container)
Definition bslstl_iterator.h:1621
Definition bslmf_usesallocator.h:165