BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl_stack_cpp03.h
Go to the documentation of this file.
1/// @file bslstl_stack_cpp03.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslstl_stack_cpp03.h -*-C++-*-
8
9// Automatically generated file. **DO NOT EDIT**
10
11#ifndef INCLUDED_BSLSTL_STACK_CPP03
12#define INCLUDED_BSLSTL_STACK_CPP03
13
14/// @defgroup bslstl_stack_cpp03 bslstl_stack_cpp03
15/// @brief Provide C++03 implementation for bslstl_stack.h
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslstl
19/// @{
20/// @addtogroup bslstl_stack_cpp03
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslstl_stack_cpp03-purpose"> Purpose</a>
25/// * <a href="#bslstl_stack_cpp03-classes"> Classes </a>
26/// * <a href="#bslstl_stack_cpp03-description"> Description </a>
27///
28/// # Purpose {#bslstl_stack_cpp03-purpose}
29/// Provide C++03 implementation for bslstl_stack.h
30///
31/// # Classes {#bslstl_stack_cpp03-classes}
32/// See bslstl_stack.h for list of classes
33///
34/// @see bslstl_stack
35///
36/// # Description {#bslstl_stack_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 Sun Sep 1 18:48:19 2024
48/// Command line: sim_cpp11_features.pl bslstl_stack.h
49/// @}
50/** @} */
51/** @} */
52
53/** @addtogroup bsl
54 * @{
55 */
56/** @addtogroup bslstl
57 * @{
58 */
59/** @addtogroup bslstl_stack_cpp03
60 * @{
61 */
62
63#ifdef COMPILING_BSLSTL_STACK_H
64
65namespace bsl {
66
67 // ===========
68 // class stack
69 // ===========
70
71/// This `class` defines a container adapter which supports access primarily
72/// via `push`, `pop`, and `top`. This type can be based on a variety of
73/// other container types, including `deque`, `vector`, and `list`. This
74/// type is value-semantic if the supporting `CONTAINER` and `VALUE` are
75/// value-semantic.
76///
77/// Note that we never use `VALUE` in the implementation except in the
78/// default argument of `CONTAINER`. We use `CONTAINER::value_type` for
79/// everything, which means that if `CONTAINER` is specified, then `VALUE`
80/// is ignored.
81///
82/// See @ref bslstl_stack_cpp03
83template <class VALUE, class CONTAINER = deque<VALUE> >
84class stack {
85
86#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
87 // STATIC CHECK: Type mismatch is UB per C++17
89#endif
90
91 private:
92 // PRIVATE TYPES
93
94 /// This `typedef` is a convenient alias for the utility associated with
95 /// movable references.
96 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
97
98 public:
99 // PUBLIC TYPES
100 typedef typename CONTAINER::value_type value_type;
101 typedef typename CONTAINER::reference reference;
102 typedef typename CONTAINER::const_reference const_reference;
103 typedef typename CONTAINER::size_type size_type;
104 typedef CONTAINER container_type;
105
106
107 protected:
108 // PROTECTED DATA
109 container_type c; // We are required by the standard to have the
110 // container be a protected variable named 'c'.
111
112 private:
113 // FRIENDS
114 template <class VAL, class CONT>
115 friend bool operator==(const stack<VAL, CONT>&, const stack<VAL, CONT>&);
116 template <class VAL, class CONT>
117 friend bool operator!=(const stack<VAL, CONT>&, const stack<VAL, CONT>&);
118 template <class VAL, class CONT>
119 friend bool operator< (const stack<VAL, CONT>&, const stack<VAL, CONT>&);
120 template <class VAL, class CONT>
121 friend bool operator> (const stack<VAL, CONT>&, const stack<VAL, CONT>&);
122 template <class VAL, class CONT>
123 friend bool operator<=(const stack<VAL, CONT>&, const stack<VAL, CONT>&);
124 template <class VAL, class CONT>
125 friend bool operator>=(const stack<VAL, CONT>&, const stack<VAL, CONT>&);
126#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
127 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
128 template <class VAL, three_way_comparable CONT>
129 friend compare_three_way_result_t<CONT>
130 operator<=>(const stack<VAL, CONT>&, const stack<VAL, CONT>&);
131#endif
132
133 public:
134 // TRAITS
136 stack,
137 BloombergLP::bslma::UsesBslmaAllocator,
138 BloombergLP::bslma::UsesBslmaAllocator<container_type>::value);
139
140 // CREATORS
141
142 /// Create an empty stack. No allocator will be provided to the
143 /// underlying container. That container's memory allocation will be
144 /// provided by the default allocator of its type.
145 explicit stack();
146
147 /// Create a stack having the value of the specified `original`. The
148 /// currently installed default allocator is used to supply memory.
149 stack(const stack& original);
150
151 /// Create a stack having the value of the specified `original` by
152 /// moving the contents of `original` to the new stack. The allocator
153 /// associated with `original` is propagated for use in the new stack.
154 /// `original` is left in a valid but unspecified state.
155 stack(BloombergLP::bslmf::MovableRef<stack> original);
156
157 /// Create a stack whose underlying container has the value of the
158 /// specified `container`. The currently installed default allocator is
159 /// used to supply memory.
160 explicit
161 stack(const CONTAINER& container);
162
163 /// Create a stack whose underlying container has the value of the
164 /// specified `container` (on entry) by moving the contents of
165 /// `container` to the new stack. The allocator associated with
166 /// `container` is propagated for use in the new stack. `container` is
167 /// left in a valid but unspecified state.
168 explicit
169 stack(BloombergLP::bslmf::MovableRef<CONTAINER> container);
170
171 /// Create an empty stack, and use the specified `basicAllocator` to
172 /// supply memory. If `CONTAINER::allocator_type` does not exist, this
173 /// constructor may not be used.
174 template <class ALLOCATOR>
175 explicit
176 stack(const ALLOCATOR& basicAllocator,
178 ALLOCATOR>::type * = 0);
179
180 /// Create a stack whose underlying container has the value of the
181 /// specified `container`, and use the specified `basicAllocator` to
182 /// supply memory. If `CONTAINER::allocator_type` does not exist, this
183 /// constructor may not be used.
184 template <class ALLOCATOR>
185 stack(const CONTAINER& container,
186 const ALLOCATOR& basicAllocator,
188 ALLOCATOR>::type * = 0);
189
190 /// Create a stack having the value of the specified stack `original`
191 /// and use the specified `basicAllocator` to supply memory. If
192 /// `CONTAINER::allocator_type` does not exist, this constructor may not
193 /// be used.
194 template <class ALLOCATOR>
195 stack(const stack& original,
196 const ALLOCATOR& basicAllocator,
198 ALLOCATOR>::type * = 0);
199
200 /// Create a stack whose underlying container has the value of the
201 /// specified `container` (on entry) that uses `basicAllocator` to
202 /// supply memory by using the allocator-extended move constructor of
203 /// `CONTAINER. `container' is left in a valid but unspecified state.
204 /// A `bslma::Allocator *` can be supplied for `basicAllocator` if the
205 /// (template parameter) `ALLOCATOR` is `bsl::allocator` (the default).
206 /// This method assumes that `CONTAINER` has a move constructor. If
207 /// `CONTAINER::allocator_type` does not exist, this constructor may not
208 /// be used.
209 template <class ALLOCATOR>
210 stack(BloombergLP::bslmf::MovableRef<CONTAINER> container,
211 const ALLOCATOR& basicAllocator,
213 ALLOCATOR>::type * = 0);
214
215 /// Create a stack having the value of the specified `original` (on
216 /// entry) that uses `basicAllocator` to supply memory by using the
217 /// allocator-extended moved constructor of `CONTAINER`. `original` is
218 /// left in a valid but unspecified state. Note that a
219 /// `bslma::Allocator *` can be supplied for `basicAllocator` if the
220 /// (template parameter) `ALLOCATOR` is `bsl::allocator` (the default).
221 /// Also note that this method assumes that `CONTAINER` has a move
222 /// constructor. Also note that if `CONTAINER::allocator_type` does not
223 /// exist, this constructor may not be used.
224 template <class ALLOCATOR>
225 stack(BloombergLP::bslmf::MovableRef<stack> original,
226 const ALLOCATOR& basicAllocator,
228 ALLOCATOR>::type * = 0);
229
230 // MANIPULATORS
231
232 /// Assign to this object the value of the specified `rhs` object, and
233 /// return a reference providing modifiable access to this object.
234 stack& operator=(const stack& rhs);
235
236 /// Assign to this object the value of the specified `rhs` object, and
237 /// return a reference providing modifiable access to this object. The
238 /// contents of `rhs` are moved to this stack using the move-assignment
239 /// operator of `CONTAINER`. `rhs` is left in a valid but unspecified
240 /// state, and if an exception is thrown, `*this` is left in a valid but
241 /// unspecified state.
242 stack& operator=(BloombergLP::bslmf::MovableRef<stack> rhs)
244
245#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
246// {{{ BEGIN GENERATED CODE
247// Command line: sim_cpp11_features.pl bslstl_stack.h
248#ifndef BSLSTL_STACK_VARIADIC_LIMIT
249#define BSLSTL_STACK_VARIADIC_LIMIT 10
250#endif
251#ifndef BSLSTL_STACK_VARIADIC_LIMIT_A
252#define BSLSTL_STACK_VARIADIC_LIMIT_A BSLSTL_STACK_VARIADIC_LIMIT
253#endif
254#if BSLSTL_STACK_VARIADIC_LIMIT_A >= 0
256#endif // BSLSTL_STACK_VARIADIC_LIMIT_A >= 0
257
258#if BSLSTL_STACK_VARIADIC_LIMIT_A >= 1
259 template <class Args_01>
261#endif // BSLSTL_STACK_VARIADIC_LIMIT_A >= 1
262
263#if BSLSTL_STACK_VARIADIC_LIMIT_A >= 2
264 template <class Args_01,
265 class Args_02>
267 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
268#endif // BSLSTL_STACK_VARIADIC_LIMIT_A >= 2
269
270#if BSLSTL_STACK_VARIADIC_LIMIT_A >= 3
271 template <class Args_01,
272 class Args_02,
273 class Args_03>
275 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
276 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
277#endif // BSLSTL_STACK_VARIADIC_LIMIT_A >= 3
278
279#if BSLSTL_STACK_VARIADIC_LIMIT_A >= 4
280 template <class Args_01,
281 class Args_02,
282 class Args_03,
283 class Args_04>
285 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
286 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
287 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
288#endif // BSLSTL_STACK_VARIADIC_LIMIT_A >= 4
289
290#if BSLSTL_STACK_VARIADIC_LIMIT_A >= 5
291 template <class Args_01,
292 class Args_02,
293 class Args_03,
294 class Args_04,
295 class Args_05>
297 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
298 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
299 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
300 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
301#endif // BSLSTL_STACK_VARIADIC_LIMIT_A >= 5
302
303#if BSLSTL_STACK_VARIADIC_LIMIT_A >= 6
304 template <class Args_01,
305 class Args_02,
306 class Args_03,
307 class Args_04,
308 class Args_05,
309 class Args_06>
311 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
312 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
313 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
314 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
315 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
316#endif // BSLSTL_STACK_VARIADIC_LIMIT_A >= 6
317
318#if BSLSTL_STACK_VARIADIC_LIMIT_A >= 7
319 template <class Args_01,
320 class Args_02,
321 class Args_03,
322 class Args_04,
323 class Args_05,
324 class Args_06,
325 class Args_07>
327 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
328 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
329 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
330 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
331 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
332 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
333#endif // BSLSTL_STACK_VARIADIC_LIMIT_A >= 7
334
335#if BSLSTL_STACK_VARIADIC_LIMIT_A >= 8
336 template <class Args_01,
337 class Args_02,
338 class Args_03,
339 class Args_04,
340 class Args_05,
341 class Args_06,
342 class Args_07,
343 class Args_08>
345 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
346 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
347 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
348 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
349 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
350 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
351 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
352#endif // BSLSTL_STACK_VARIADIC_LIMIT_A >= 8
353
354#if BSLSTL_STACK_VARIADIC_LIMIT_A >= 9
355 template <class Args_01,
356 class Args_02,
357 class Args_03,
358 class Args_04,
359 class Args_05,
360 class Args_06,
361 class Args_07,
362 class Args_08,
363 class Args_09>
365 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
366 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
367 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
368 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
369 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
370 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
371 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
372 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
373#endif // BSLSTL_STACK_VARIADIC_LIMIT_A >= 9
374
375#if BSLSTL_STACK_VARIADIC_LIMIT_A >= 10
376 template <class Args_01,
377 class Args_02,
378 class Args_03,
379 class Args_04,
380 class Args_05,
381 class Args_06,
382 class Args_07,
383 class Args_08,
384 class Args_09,
385 class Args_10>
387 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
388 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
389 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
390 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
391 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
392 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
393 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
394 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
395 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
396#endif // BSLSTL_STACK_VARIADIC_LIMIT_A >= 10
397
398#else
399// The generated code below is a workaround for the absence of perfect
400// forwarding in some compilers.
401 template <class... Args>
403
404// }}} END GENERATED CODE
405#endif
406
407 /// Remove the top element from this stack. The behavior is undefined
408 /// if this stack is empty.
409 void pop();
410
411 /// Push the specified `value` onto the top of this stack.
412 void push(const value_type& value);
413
414 /// Push onto this stack a `value_type` object having the value of the
415 /// specified `value` (on entry) by moving the contents of `value` to
416 /// the new object on this stack. `value` is left in a valid but
417 /// unspecified state.
418 void push(BloombergLP::bslmf::MovableRef<value_type> value);
419
420 /// Exchange the value of this stack with the value of the specified
421 /// `other` stack.
423 bsl::is_nothrow_swappable<CONTAINER>::value);
424
425 /// Return a reference to the element at the top of this stack. The
426 /// behavior is undefined if this stack is empty.
427 reference top();
428
429 // ACCESSORS
430
431 /// Return `true` if this stack contains no elements and `false`
432 /// otherwise.
433 bool empty() const;
434
435 /// Return the number of elements contained in this stack.
436 size_type size() const;
437
438 /// Return a reference providing non-modifiable access to the element at
439 /// the top of this stack. The behavior is undefined if the stack is
440 /// empty.
441 const_reference top() const;
442};
443
444#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
445// CLASS TEMPLATE DEDUCTION GUIDES
446
447/// Deduce the template parameters `VALUE` and `CONTAINER` from the
448/// parameters supplied to the constructor of `stack`. This deduction guide
449/// does not participate if the parameter meets the requirements for a
450/// standard allocator.
451template<class CONTAINER,
452 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<CONTAINER>>
453 >
454stack(CONTAINER) -> stack<typename CONTAINER::value_type, CONTAINER>;
455
456/// Deduce the template parameters `VALUE` and `CONTAINER` from the
457/// parameters supplied to the constructor of `stack`. This deduction
458/// guide does not participate unless the supplied allocator is convertible
459/// to the underlying container's `allocator_type`.
460template<
461 class CONTAINER,
462 class ALLOCATOR,
463 class = bsl::enable_if_t<bsl::uses_allocator_v<CONTAINER, ALLOCATOR>>
464 >
465stack(CONTAINER, ALLOCATOR) -> stack<typename CONTAINER::value_type, CONTAINER>;
466#endif
467
468// FREE OPERATORS
469
470/// Return `true` if the specified `lhs` and `rhs` objects have the same
471/// value, and `false` otherwise. Two `stack` objects `lhs` and `rhs` have
472/// the same value if they have the same number of elements, and each
473/// element in the ordered sequence of elements of `lhs` has the same value
474/// as the corresponding element in the ordered sequence of elements of
475/// `rhs`. This method requires that the (template parameter) type `VALUE`
476/// be `equality-comparable` (see {Requirements on `VALUE`}).
477template <class VALUE, class CONTAINER>
478bool operator==(const stack<VALUE, CONTAINER>& lhs,
479 const stack<VALUE, CONTAINER>& rhs);
480
481/// Return `true` if the specified `lhs` and `rhs` objects do not have the
482/// same value, and `false` otherwise. Two `stack` objects `lhs` and `rhs`
483/// do not have the same value if they do not have the same number of
484/// elements, or some element in the ordered sequence of elements of `lhs`
485/// does not have the same value as the corresponding element in the ordered
486/// sequence of elements of `rhs`. This method requires that the (template
487/// parameter) type `VALUE` be `equality-comparable` (see {Requirements on
488/// `VALUE`}).
489template <class VALUE, class CONTAINER>
490bool operator!=(const stack<VALUE, CONTAINER>& lhs,
491 const stack<VALUE, CONTAINER>& rhs);
492
493/// Return `true` if the value of the specified `lhs` stack is
494/// lexicographically less than that of the specified `rhs` stack, and
495/// `false` otherwise. Given iterators `i` and `j` over the respective
496/// sequences `[lhs.begin() .. lhs.end())` and `[rhs.begin() .. rhs.end())`,
497/// the value of stack `lhs` is lexicographically less than that of stack
498/// `rhs` if `true == *i < *j` for the first pair of corresponding iterator
499/// positions where `*i < *j` and `*j < *i` are not both `false`. If no
500/// such corresponding iterator position exists, the value of `lhs` is
501/// lexicographically less than that of `rhs` if `lhs.size() < rhs.size()`.
502/// This method requires that `operator<`, inducing a total order, be
503/// defined for `value_type`.
504template <class VALUE, class CONTAINER>
505bool operator< (const stack<VALUE, CONTAINER>& lhs,
506 const stack<VALUE, CONTAINER>& rhs);
507
508/// Return `true` if the value of the specified `lhs` stack is
509/// lexicographically greater than that of the specified `rhs` stack, and
510/// `false` otherwise. The value of stack `lhs` is lexicographically
511/// greater than that of stack `rhs` if `rhs` is lexicographically less than
512/// `lhs` (see `operator<`). This method requires that `operator<`,
513/// inducing a total order, be defined for `value_type`. Note that this
514/// operator returns `rhs < lhs`.
515template <class VALUE, class CONTAINER>
516bool operator> (const stack<VALUE, CONTAINER>& lhs,
517 const stack<VALUE, CONTAINER>& rhs);
518
519/// Return `true` if the value of the specified `lhs` stack is
520/// lexicographically less than or equal to that of the specified `rhs`
521/// stack, and `false` otherwise. The value of stack `lhs` is
522/// lexicographically less than or equal to that of stack `rhs` if `rhs` is
523/// not lexicographically less than `lhs` (see `operator<`). This method
524/// requires that `operator<`, inducing a total order, be defined for
525/// `value_type`. Note that this operator returns `!(rhs < lhs)`.
526template <class VALUE, class CONTAINER>
527bool operator<=(const stack<VALUE, CONTAINER>& lhs,
528 const stack<VALUE, CONTAINER>& rhs);
529
530/// Return `true` if the value of the specified `lhs` stack is
531/// lexicographically greater than or equal to that of the specified `rhs`
532/// stack, and `false` otherwise. The value of stack `lhs` is
533/// lexicographically greater than or equal to that of stack `rhs` if `lhs`
534/// is not lexicographically less than `rhs` (see `operator<`). This method
535/// requires that `operator<`, inducing a total order, be defined for
536/// `value_type`. Note that this operator returns `!(lhs < rhs)`.
537template <class VALUE, class CONTAINER>
538bool operator>=(const stack<VALUE, CONTAINER>& lhs,
539 const stack<VALUE, CONTAINER>& rhs);
540
541// FREE FUNCTIONS
542
543/// Swap the value of the specified `lhs` stack with the value of the
544/// specified `rhs` stack.
545template <class VALUE, class CONTAINER>
546void swap(stack<VALUE, CONTAINER>& lhs,
547 stack<VALUE, CONTAINER>& rhs)
549
550//=============================================================================
551// TEMPLATE AND INLINE FUNCTION DEFINITIONS
552//=============================================================================
553
554 // -----------
555 // class stack
556 // -----------
557
558// CREATORS
559template <class VALUE, class CONTAINER>
560inline
562: c()
563{
564}
565
566template <class VALUE, class CONTAINER>
567inline
568stack<VALUE, CONTAINER>::stack(const CONTAINER& container)
569: c(container)
570{
571}
572
573template <class VALUE, class CONTAINER>
574inline
575stack<VALUE, CONTAINER>::stack(BloombergLP::bslmf::MovableRef<stack> original)
576: c(MoveUtil::move(MoveUtil::access(original).c))
577{
578}
579
580template <class VALUE, class CONTAINER>
581template <class ALLOCATOR>
582inline
583stack<VALUE, CONTAINER>::stack(const ALLOCATOR& basicAllocator,
585 ALLOCATOR>::type *)
586: c(basicAllocator)
587{
588}
589
590template <class VALUE, class CONTAINER>
591template <class ALLOCATOR>
592inline
593stack<VALUE, CONTAINER>::stack(
594 const CONTAINER& container,
595 const ALLOCATOR& basicAllocator,
597 ALLOCATOR>::type *)
598: c(container, basicAllocator)
599{
600}
601
602template <class VALUE, class CONTAINER>
603inline
604stack<VALUE, CONTAINER>::stack(const stack& original)
605: c(original.c)
606{
607}
608
609template <class VALUE, class CONTAINER>
610template <class ALLOCATOR>
611inline
612stack<VALUE, CONTAINER>::stack(
613 const stack& original,
614 const ALLOCATOR& basicAllocator,
616 ALLOCATOR>::type *)
617: c(original.c, basicAllocator)
618{
619}
620
621template <class VALUE, class CONTAINER>
622inline
623stack<VALUE, CONTAINER>::stack(BloombergLP::bslmf::MovableRef<CONTAINER>
624 container)
625: c(MoveUtil::move(container))
626{
627}
628
629template <class VALUE, class CONTAINER>
630template <class ALLOCATOR>
631inline
632stack<VALUE, CONTAINER>::stack(
633 BloombergLP::bslmf::MovableRef<CONTAINER> container,
634 const ALLOCATOR& basicAllocator,
636 ALLOCATOR>::type *)
637: c(MoveUtil::move(container), basicAllocator)
638{
639}
640
641template <class VALUE, class CONTAINER>
642template <class ALLOCATOR>
643inline
644stack<VALUE, CONTAINER>::stack(
645 BloombergLP::bslmf::MovableRef<stack> original,
646 const ALLOCATOR& basicAllocator,
648 ALLOCATOR>::type *)
649: c(MoveUtil::move(MoveUtil::access(original).c), basicAllocator)
650{
651}
652
653// MANIPULATORS
654template <class VALUE, class CONTAINER>
655inline
656stack<VALUE, CONTAINER>& stack<VALUE, CONTAINER>::operator=(const stack& rhs)
657{
658 c = rhs.c;
659
660 return *this;
661}
662
663template <class VALUE, class CONTAINER>
664inline
665stack<VALUE, CONTAINER>& stack<VALUE, CONTAINER>::operator=(
666 BloombergLP::bslmf::MovableRef<stack> rhs)
668{
669 c = MoveUtil::move(MoveUtil::access(rhs).c);
670 return *this;
671}
672
673#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
674// {{{ BEGIN GENERATED CODE
675// Command line: sim_cpp11_features.pl bslstl_stack.h
676#ifndef BSLSTL_STACK_VARIADIC_LIMIT
677#define BSLSTL_STACK_VARIADIC_LIMIT 10
678#endif
679#ifndef BSLSTL_STACK_VARIADIC_LIMIT_B
680#define BSLSTL_STACK_VARIADIC_LIMIT_B BSLSTL_STACK_VARIADIC_LIMIT
681#endif
682#if BSLSTL_STACK_VARIADIC_LIMIT_B >= 0
683template <class VALUE, class CONTAINER>
684inline
685typename stack<VALUE, CONTAINER>::reference
686stack<VALUE, CONTAINER>::emplace(
687 )
688{
689 c.emplace_back();
690 return top();
691}
692#endif // BSLSTL_STACK_VARIADIC_LIMIT_B >= 0
693
694#if BSLSTL_STACK_VARIADIC_LIMIT_B >= 1
695template <class VALUE, class CONTAINER>
696template <class Args_01>
697inline
698typename stack<VALUE, CONTAINER>::reference
699stack<VALUE, CONTAINER>::emplace(
700 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
701{
702 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01));
703 return top();
704}
705#endif // BSLSTL_STACK_VARIADIC_LIMIT_B >= 1
706
707#if BSLSTL_STACK_VARIADIC_LIMIT_B >= 2
708template <class VALUE, class CONTAINER>
709template <class Args_01,
710 class Args_02>
711inline
712typename stack<VALUE, CONTAINER>::reference
713stack<VALUE, CONTAINER>::emplace(
714 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
715 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
716{
717 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
718 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02));
719 return top();
720}
721#endif // BSLSTL_STACK_VARIADIC_LIMIT_B >= 2
722
723#if BSLSTL_STACK_VARIADIC_LIMIT_B >= 3
724template <class VALUE, class CONTAINER>
725template <class Args_01,
726 class Args_02,
727 class Args_03>
728inline
729typename stack<VALUE, CONTAINER>::reference
730stack<VALUE, CONTAINER>::emplace(
731 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
732 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
733 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
734{
735 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
736 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
737 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03));
738 return top();
739}
740#endif // BSLSTL_STACK_VARIADIC_LIMIT_B >= 3
741
742#if BSLSTL_STACK_VARIADIC_LIMIT_B >= 4
743template <class VALUE, class CONTAINER>
744template <class Args_01,
745 class Args_02,
746 class Args_03,
747 class Args_04>
748inline
749typename stack<VALUE, CONTAINER>::reference
750stack<VALUE, CONTAINER>::emplace(
751 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
752 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
753 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
754 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
755{
756 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
757 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
758 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
759 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04));
760 return top();
761}
762#endif // BSLSTL_STACK_VARIADIC_LIMIT_B >= 4
763
764#if BSLSTL_STACK_VARIADIC_LIMIT_B >= 5
765template <class VALUE, class CONTAINER>
766template <class Args_01,
767 class Args_02,
768 class Args_03,
769 class Args_04,
770 class Args_05>
771inline
772typename stack<VALUE, CONTAINER>::reference
773stack<VALUE, CONTAINER>::emplace(
774 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
775 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
776 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
777 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
778 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
779{
780 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
781 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
782 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
783 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
784 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05));
785 return top();
786}
787#endif // BSLSTL_STACK_VARIADIC_LIMIT_B >= 5
788
789#if BSLSTL_STACK_VARIADIC_LIMIT_B >= 6
790template <class VALUE, class CONTAINER>
791template <class Args_01,
792 class Args_02,
793 class Args_03,
794 class Args_04,
795 class Args_05,
796 class Args_06>
797inline
798typename stack<VALUE, CONTAINER>::reference
799stack<VALUE, CONTAINER>::emplace(
800 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
801 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
802 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
803 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
804 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
805 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
806{
807 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
808 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
809 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
810 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
811 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05),
812 BSLS_COMPILERFEATURES_FORWARD(Args_06,args_06));
813 return top();
814}
815#endif // BSLSTL_STACK_VARIADIC_LIMIT_B >= 6
816
817#if BSLSTL_STACK_VARIADIC_LIMIT_B >= 7
818template <class VALUE, class CONTAINER>
819template <class Args_01,
820 class Args_02,
821 class Args_03,
822 class Args_04,
823 class Args_05,
824 class Args_06,
825 class Args_07>
826inline
827typename stack<VALUE, CONTAINER>::reference
828stack<VALUE, CONTAINER>::emplace(
829 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
830 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
831 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
832 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
833 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
834 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
835 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
836{
837 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
838 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
839 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
840 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
841 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05),
842 BSLS_COMPILERFEATURES_FORWARD(Args_06,args_06),
843 BSLS_COMPILERFEATURES_FORWARD(Args_07,args_07));
844 return top();
845}
846#endif // BSLSTL_STACK_VARIADIC_LIMIT_B >= 7
847
848#if BSLSTL_STACK_VARIADIC_LIMIT_B >= 8
849template <class VALUE, class CONTAINER>
850template <class Args_01,
851 class Args_02,
852 class Args_03,
853 class Args_04,
854 class Args_05,
855 class Args_06,
856 class Args_07,
857 class Args_08>
858inline
859typename stack<VALUE, CONTAINER>::reference
860stack<VALUE, CONTAINER>::emplace(
861 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
862 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
863 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
864 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
865 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
866 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
867 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
868 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
869{
870 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
871 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
872 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
873 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
874 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05),
875 BSLS_COMPILERFEATURES_FORWARD(Args_06,args_06),
876 BSLS_COMPILERFEATURES_FORWARD(Args_07,args_07),
877 BSLS_COMPILERFEATURES_FORWARD(Args_08,args_08));
878 return top();
879}
880#endif // BSLSTL_STACK_VARIADIC_LIMIT_B >= 8
881
882#if BSLSTL_STACK_VARIADIC_LIMIT_B >= 9
883template <class VALUE, class CONTAINER>
884template <class Args_01,
885 class Args_02,
886 class Args_03,
887 class Args_04,
888 class Args_05,
889 class Args_06,
890 class Args_07,
891 class Args_08,
892 class Args_09>
893inline
894typename stack<VALUE, CONTAINER>::reference
895stack<VALUE, CONTAINER>::emplace(
896 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
897 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
898 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
899 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
900 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
901 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
902 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
903 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
904 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
905{
906 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
907 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
908 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
909 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
910 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05),
911 BSLS_COMPILERFEATURES_FORWARD(Args_06,args_06),
912 BSLS_COMPILERFEATURES_FORWARD(Args_07,args_07),
913 BSLS_COMPILERFEATURES_FORWARD(Args_08,args_08),
914 BSLS_COMPILERFEATURES_FORWARD(Args_09,args_09));
915 return top();
916}
917#endif // BSLSTL_STACK_VARIADIC_LIMIT_B >= 9
918
919#if BSLSTL_STACK_VARIADIC_LIMIT_B >= 10
920template <class VALUE, class CONTAINER>
921template <class Args_01,
922 class Args_02,
923 class Args_03,
924 class Args_04,
925 class Args_05,
926 class Args_06,
927 class Args_07,
928 class Args_08,
929 class Args_09,
930 class Args_10>
931inline
932typename stack<VALUE, CONTAINER>::reference
933stack<VALUE, CONTAINER>::emplace(
934 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
935 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
936 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
937 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
938 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
939 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
940 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
941 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
942 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
943 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
944{
945 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args_01,args_01),
946 BSLS_COMPILERFEATURES_FORWARD(Args_02,args_02),
947 BSLS_COMPILERFEATURES_FORWARD(Args_03,args_03),
948 BSLS_COMPILERFEATURES_FORWARD(Args_04,args_04),
949 BSLS_COMPILERFEATURES_FORWARD(Args_05,args_05),
950 BSLS_COMPILERFEATURES_FORWARD(Args_06,args_06),
951 BSLS_COMPILERFEATURES_FORWARD(Args_07,args_07),
952 BSLS_COMPILERFEATURES_FORWARD(Args_08,args_08),
953 BSLS_COMPILERFEATURES_FORWARD(Args_09,args_09),
954 BSLS_COMPILERFEATURES_FORWARD(Args_10,args_10));
955 return top();
956}
957#endif // BSLSTL_STACK_VARIADIC_LIMIT_B >= 10
958
959#else
960// The generated code below is a workaround for the absence of perfect
961// forwarding in some compilers.
962template <class VALUE, class CONTAINER>
963template <class... Args>
964inline
965typename stack<VALUE, CONTAINER>::reference
966stack<VALUE, CONTAINER>::emplace(
968{
969 c.emplace_back(BSLS_COMPILERFEATURES_FORWARD(Args,args)...);
970 return top();
971}
972// }}} END GENERATED CODE
973#endif
974
975template <class VALUE, class CONTAINER>
976inline
977void stack<VALUE, CONTAINER>::pop()
978{
980
981 c.pop_back();
982}
983
984template <class VALUE, class CONTAINER>
985inline
986void stack<VALUE, CONTAINER>::push(const value_type& value)
987{
988 c.push_back(value);
989}
990
991template <class VALUE, class CONTAINER>
992inline
993void stack<VALUE, CONTAINER>::push(BloombergLP::bslmf::MovableRef<value_type>
994 value)
995{
996 c.push_back(MoveUtil::move(value));
997}
998
999template <class VALUE, class CONTAINER>
1000inline
1001void stack<VALUE, CONTAINER>::swap(stack& other)
1003 bsl::is_nothrow_swappable<CONTAINER>::value)
1004{
1005 BloombergLP::bslalg::SwapUtil::swap(&c, &other.c);
1006}
1007
1008template <class VALUE, class CONTAINER>
1009inline
1010typename CONTAINER::reference stack<VALUE, CONTAINER>::top()
1011{
1013
1014 return c.back();
1015}
1016
1017// ACCESSORS
1018template <class VALUE, class CONTAINER>
1019inline
1020bool stack<VALUE, CONTAINER>::empty() const
1021{
1022 return 0 == c.size();
1023}
1024
1025template <class VALUE, class CONTAINER>
1026inline
1027typename CONTAINER::size_type stack<VALUE, CONTAINER>::size() const
1028{
1029 return c.size();
1030}
1031
1032template <class VALUE, class CONTAINER>
1033inline
1034typename CONTAINER::const_reference stack<VALUE, CONTAINER>::top() const
1035{
1036 return c.back();
1037}
1038
1039// FREE OPERATORS
1040template <class VALUE, class CONTAINER>
1041inline
1042bool operator==(const stack<VALUE, CONTAINER>& lhs,
1043 const stack<VALUE, CONTAINER>& rhs)
1044{
1045 return lhs.c == rhs.c;
1046}
1047
1048template <class VALUE, class CONTAINER>
1049inline
1050bool operator!=(const stack<VALUE, CONTAINER>& lhs,
1051 const stack<VALUE, CONTAINER>& rhs)
1052{
1053 return lhs.c != rhs.c;
1054}
1055
1056template <class VALUE, class CONTAINER>
1057inline
1058bool operator< (const stack<VALUE, CONTAINER>& lhs,
1059 const stack<VALUE, CONTAINER>& rhs)
1060{
1061 return lhs.c < rhs.c;
1062}
1063
1064template <class VALUE, class CONTAINER>
1065inline
1066bool operator> (const stack<VALUE, CONTAINER>& lhs,
1067 const stack<VALUE, CONTAINER>& rhs)
1068{
1069 return lhs.c > rhs.c;
1070}
1071
1072template <class VALUE, class CONTAINER>
1073inline
1074bool operator<=(const stack<VALUE, CONTAINER>& lhs,
1075 const stack<VALUE, CONTAINER>& rhs)
1076{
1077 return lhs.c <= rhs.c;
1078}
1079
1080template <class VALUE, class CONTAINER>
1081inline
1082bool operator>=(const stack<VALUE, CONTAINER>& lhs,
1083 const stack<VALUE, CONTAINER>& rhs)
1084{
1085 return lhs.c >= rhs.c;
1086}
1087
1088#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
1089 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1090template <class VALUE, three_way_comparable CONTAINER>
1091inline compare_three_way_result_t<CONTAINER>
1092operator<=>(const stack<VALUE, CONTAINER>& lhs,
1093 const stack<VALUE, CONTAINER>& rhs)
1094{
1095 return lhs.c <=> rhs.c;
1096}
1097#endif
1098
1099// FREE FUNCTIONS
1100template <class VALUE, class CONTAINER>
1101inline
1102void swap(stack<VALUE, CONTAINER>& lhs,
1103 stack<VALUE, CONTAINER>& rhs)
1105{
1106 lhs.swap(rhs);
1107}
1108
1109} // close namespace bsl
1110
1111#else // if ! defined(DEFINED_BSLSTL_STACK_H)
1112# error Not valid except when included from bslstl_stack.h
1113#endif // ! defined(COMPILING_BSLSTL_STACK_H)
1114
1115#endif // ! defined(INCLUDED_BSLSTL_STACK_CPP03)
1116
1117// ----------------------------------------------------------------------------
1118// Copyright 2016 Bloomberg Finance L.P.
1119//
1120// Licensed under the Apache License, Version 2.0 (the "License");
1121// you may not use this file except in compliance with the License.
1122// You may obtain a copy of the License at
1123//
1124// http://www.apache.org/licenses/LICENSE-2.0
1125//
1126// Unless required by applicable law or agreed to in writing, software
1127// distributed under the License is distributed on an "AS IS" BASIS,
1128// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1129// See the License for the specific language governing permissions and
1130// limitations under the License.
1131// ----------------------------- END-OF-FILE ----------------------------------
1132
1133/** @} */
1134/** @} */
1135/** @} */
#define BSLMF_NESTED_TRAIT_DECLARATION_IF(t_TYPE, t_TRAIT, t_COND)
Definition bslmf_nestedtraitdeclaration.h:243
CONTAINER::reference reference
Definition bslstl_stack.h:411
CONTAINER::size_type size_type
Definition bslstl_stack.h:413
friend bool operator>(const stack< VAL, CONT > &, const stack< VAL, CONT > &)
stack()
Definition bslstl_stack.h:720
friend bool operator<(const stack< VAL, CONT > &, const stack< VAL, CONT > &)
CONTAINER container_type
Definition bslstl_stack.h:414
friend bool operator!=(const stack< VAL, CONT > &, const stack< VAL, CONT > &)
friend bool operator>=(const stack< VAL, CONT > &, const stack< VAL, CONT > &)
bool empty() const
Definition bslstl_stack.h:889
friend bool operator==(const stack< VAL, CONT > &, const stack< VAL, CONT > &)
void pop()
Definition bslstl_stack.h:846
void push(const value_type &value)
Push the specified value onto the top of this stack.
Definition bslstl_stack.h:855
void swap(stack &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl reference top()
Definition bslstl_stack.h:586
stack & operator=(const stack &rhs)
Definition bslstl_stack.h:815
friend bool operator<=(const stack< VAL, CONT > &, const stack< VAL, CONT > &)
size_type size() const
Return the number of elements contained in this stack.
Definition bslstl_stack.h:896
CONTAINER::value_type value_type
Definition bslstl_stack.h:410
CONTAINER::const_reference const_reference
Definition bslstl_stack.h:412
container_type c
Definition bslstl_stack.h:419
reference emplace(Args &&... args)
Definition bslstl_stack.h:837
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
static const t_TYPE value
Definition bslmf_integralconstant.h:258
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:634
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 bdlb_printmethods.h:283
BSLS_KEYWORD_CONSTEXPR bool empty(const CONTAINER &container)
Definition bslstl_iterator.h:1279
Definition bslmf_usesallocator.h:165