57 #define _STL_STACK_H 1 61 #if __cplusplus >= 201103L 62 # include <bits/uses_allocator.h> 65 namespace std _GLIBCXX_VISIBILITY(default)
67 _GLIBCXX_BEGIN_NAMESPACE_VERSION
98 template<
typename _Tp,
typename _Sequence = deque<_Tp> >
102 typedef typename _Sequence::value_type _Sequence_value_type;
103 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
104 __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
105 __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
107 template<
typename _Tp1,
typename _Seq1>
111 template<
typename _Tp1,
typename _Seq1>
116 typedef typename _Sequence::value_type value_type;
117 typedef typename _Sequence::reference reference;
118 typedef typename _Sequence::const_reference const_reference;
119 typedef typename _Sequence::size_type size_type;
120 typedef _Sequence container_type;
131 #if __cplusplus < 201103L 133 stack(
const _Sequence& __c = _Sequence())
141 stack(_Sequence&& __c = _Sequence())
142 : c(std::move(__c)) { }
150 {
return c.empty(); }
164 __glibcxx_requires_nonempty();
175 __glibcxx_requires_nonempty();
190 { c.push_back(__x); }
192 #if __cplusplus >= 201103L 194 push(value_type&& __x)
195 { c.push_back(std::move(__x)); }
197 template<
typename... _Args>
199 emplace(_Args&&... __args)
200 { c.emplace_back(std::forward<_Args>(__args)...); }
217 __glibcxx_requires_nonempty();
221 #if __cplusplus >= 201103L 224 noexcept(noexcept(swap(c, __s.c)))
244 template<
typename _Tp,
typename _Seq>
247 {
return __x.c == __y.c; }
262 template<
typename _Tp,
typename _Seq>
265 {
return __x.c < __y.c; }
268 template<
typename _Tp,
typename _Seq>
271 {
return !(__x == __y); }
274 template<
typename _Tp,
typename _Seq>
277 {
return __y < __x; }
280 template<
typename _Tp,
typename _Seq>
283 {
return !(__y < __x); }
286 template<
typename _Tp,
typename _Seq>
289 {
return !(__x < __y); }
291 #if __cplusplus >= 201103L 292 template<
typename _Tp,
typename _Seq>
295 noexcept(noexcept(__x.swap(__y)))
298 template<
typename _Tp,
typename _Seq,
typename _Alloc>
303 _GLIBCXX_END_NAMESPACE_VERSION
void push(const value_type &__x)
Add data to the top of the stack.
void pop()
Removes first element.
stack(const _Sequence &__c)
Default constructor creates no elements.
A standard container giving FILO behavior.
Declare uses_allocator so it can be specialized in <queue> etc.
ISO C++ entities toplevel namespace is std.
const_reference top() const