109#ifdef _GLIBCXX_CONCEPT_CHECKS
111 typedef typename _Sequence::value_type _Sequence_value_type;
112# if __cplusplus < 201103L
113 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
114 __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
116 __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
119 template<
typename _Tp1,
typename _Seq1>
123 template<
typename _Tp1,
typename _Seq1>
127#if __cpp_lib_three_way_comparison
128 template<
typename _Tp1, three_way_comparable _Seq1>
133#if __cplusplus >= 201103L
134 template<
typename _Alloc>
135 using _Uses =
typename
138#if __cplusplus >= 201703L
143 "value_type must be the same as the underlying container");
148 typedef typename _Sequence::value_type value_type;
149 typedef typename _Sequence::reference reference;
150 typedef typename _Sequence::const_reference const_reference;
151 typedef typename _Sequence::size_type size_type;
152 typedef _Sequence container_type;
163#if __cplusplus < 201103L
165 stack(
const _Sequence& __c = _Sequence())
168 template<
typename _Seq = _Sequence,
typename _Requires =
typename
174 stack(
const _Sequence& __c)
178 stack(_Sequence&& __c)
181#ifdef __glibcxx_adaptor_iterator_pair_constructor
182 template<
typename _InputIterator,
183 typename = _RequireInputIter<_InputIterator>>
184 stack(_InputIterator __first, _InputIterator __last)
185 : c(__first, __last) { }
188#if __glibcxx_containers_ranges
193 template<__detail::__container_compatible_range<_Tp> _Rg>
194 stack(from_range_t, _Rg&& __rg)
195 : c(ranges::to<_Sequence>(std::
forward<_Rg>(__rg)))
202 template<__detail::__container_compatible_range<_Tp> _Rg,
204 stack(from_range_t, _Rg&& __rg,
const _Alloc& __a)
205 : c(ranges::to<_Sequence>(std::
forward<_Rg>(__rg), __a))
209 template<
typename _Alloc,
typename _Requires = _Uses<_Alloc>>
211 stack(
const _Alloc& __a)
214 template<
typename _Alloc,
typename _Requires = _Uses<_Alloc>>
215 stack(
const _Sequence& __c,
const _Alloc& __a)
218 template<
typename _Alloc,
typename _Requires = _Uses<_Alloc>>
219 stack(_Sequence&& __c,
const _Alloc& __a)
220 : c(std::
move(__c), __a) { }
222 template<
typename _Alloc,
typename _Requires = _Uses<_Alloc>>
226 template<
typename _Alloc,
typename _Requires = _Uses<_Alloc>>
228 : c(std::
move(__q.c), __a) { }
230#if __cplusplus > 202002L
231 template<
typename _InputIterator,
typename _Alloc,
232 typename = _RequireInputIter<_InputIterator>,
233 typename = _Uses<_Alloc>>
234 stack(_InputIterator __first, _InputIterator __last,
const _Alloc& __a)
235 : c(__first, __last, __a) { }
242 _GLIBCXX_NODISCARD
bool
244 {
return c.empty(); }
260 __glibcxx_requires_nonempty();
272 __glibcxx_requires_nonempty();
287 { c.push_back(__x); }
289#if __cplusplus >= 201103L
294#if __cplusplus > 201402L
295 template<
typename... _Args>
297 emplace(_Args&&... __args)
300 template<
typename... _Args>
302 emplace(_Args&&... __args)
307#if __glibcxx_containers_ranges
308 template<__detail::__container_compatible_range<_Tp> _Rg>
310 push_range(_Rg&& __rg)
333 __glibcxx_requires_nonempty();
337#if __cplusplus >= 201103L
340#if __cplusplus > 201402L || !defined(__STRICT_ANSI__)
341 noexcept(__is_nothrow_swappable<_Sequence>::value)
343 noexcept(__is_nothrow_swappable<_Tp>::value)
351#if __glibcxx_format_ranges
352 friend class formatter<
stack<_Tp, _Sequence>, char>;
353 friend class formatter<
stack<_Tp, _Sequence>, wchar_t>;