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>
120 friend _GLIBCXX26_CONSTEXPR
bool
123 template<
typename _Tp1,
typename _Seq1>
124 friend _GLIBCXX26_CONSTEXPR
bool
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 explicit _GLIBCXX26_CONSTEXPR
175 stack(
const _Sequence& __c)
178 explicit _GLIBCXX26_CONSTEXPR
179 stack(_Sequence&& __c)
182#ifdef __glibcxx_adaptor_iterator_pair_constructor
183 template<
typename _InputIterator,
184 typename = _RequireInputIter<_InputIterator>>
186 stack(_InputIterator __first, _InputIterator __last)
187 : c(__first, __last) { }
190#if __glibcxx_containers_ranges
195 template<__detail::__container_compatible_range<_Tp> _Rg>
197 stack(from_range_t, _Rg&& __rg)
198 : c(ranges::to<_Sequence>(std::
forward<_Rg>(__rg)))
205 template<__detail::__container_compatible_range<_Tp> _Rg,
208 stack(from_range_t, _Rg&& __rg,
const _Alloc& __a)
209 : c(ranges::to<_Sequence>(std::
forward<_Rg>(__rg), __a))
213 template<
typename _Alloc,
typename _Requires = _Uses<_Alloc>>
214 explicit _GLIBCXX26_CONSTEXPR
215 stack(
const _Alloc& __a)
218 template<
typename _Alloc,
typename _Requires = _Uses<_Alloc>>
220 stack(
const _Sequence& __c,
const _Alloc& __a)
223 template<
typename _Alloc,
typename _Requires = _Uses<_Alloc>>
225 stack(_Sequence&& __c,
const _Alloc& __a)
226 : c(std::
move(__c), __a) { }
228 template<
typename _Alloc,
typename _Requires = _Uses<_Alloc>>
233 template<
typename _Alloc,
typename _Requires = _Uses<_Alloc>>
236 : c(std::
move(__q.c), __a) { }
238#if __cplusplus > 202002L
239 template<
typename _InputIterator,
typename _Alloc,
240 typename = _RequireInputIter<_InputIterator>,
241 typename = _Uses<_Alloc>>
243 stack(_InputIterator __first, _InputIterator __last,
const _Alloc& __a)
244 : c(__first, __last, __a) { }
252 _GLIBCXX26_CONSTEXPR
bool
254 {
return c.empty(); }
267 _GLIBCXX26_CONSTEXPR reference
270 __glibcxx_requires_nonempty();
279 _GLIBCXX26_CONSTEXPR const_reference
282 __glibcxx_requires_nonempty();
295 _GLIBCXX26_CONSTEXPR
void
297 { c.push_back(__x); }
299#if __cplusplus >= 201103L
300 _GLIBCXX26_CONSTEXPR
void
304#if __cplusplus > 201402L
305 template<
typename... _Args>
306 _GLIBCXX26_CONSTEXPR
decltype(
auto)
307 emplace(_Args&&... __args)
310 template<
typename... _Args>
312 emplace(_Args&&... __args)
317#if __glibcxx_containers_ranges
318 template<__detail::__container_compatible_range<_Tp> _Rg>
319 _GLIBCXX26_CONSTEXPR
void
320 push_range(_Rg&& __rg)
340 _GLIBCXX26_CONSTEXPR
void
343 __glibcxx_requires_nonempty();
347#if __cplusplus >= 201103L
348 _GLIBCXX26_CONSTEXPR
void
350#if __cplusplus > 201402L || !defined(__STRICT_ANSI__)
351 noexcept(__is_nothrow_swappable<_Sequence>::value)
353 noexcept(__is_nothrow_swappable<_Tp>::value)
361#if __glibcxx_format_ranges
362 friend class formatter<
stack<_Tp, _Sequence>, char>;
363 friend class formatter<
stack<_Tp, _Sequence>, wchar_t>;