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())
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)
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>
294 swap(stack<_Tp, _Seq>& __x, stack<_Tp, _Seq>& __y)
295 noexcept(noexcept(__x.swap(__y)))
298 template<
typename _Tp,
typename _Seq,
typename _Alloc>
299 struct uses_allocator<stack<_Tp, _Seq>, _Alloc>
300 :
public uses_allocator<_Seq, _Alloc>::type { };
303 _GLIBCXX_END_NAMESPACE_VERSION
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
const_reference top() const
void pop()
Removes first element.
void push(const value_type &__x)
Add data to the top of the stack.
ISO C++ entities toplevel namespace is std.
stack(const _Sequence &__c)
Default constructor creates no elements.
bool operator>=(const basic_string< _CharT, _Traits, _Alloc > &__lhs, const basic_string< _CharT, _Traits, _Alloc > &__rhs)
Test if string doesn't precede string.
A standard container giving FILO behavior.
bool operator>(const basic_string< _CharT, _Traits, _Alloc > &__lhs, const basic_string< _CharT, _Traits, _Alloc > &__rhs)
Test if string follows string.
void swap(_Tp &, _Tp &) noexcept(__and_< is_nothrow_move_constructible< _Tp >, is_nothrow_move_assignable< _Tp >>::value)
Swaps two values.