59 #define _STL_STACK_H 1
64 namespace std _GLIBCXX_VISIBILITY(default)
66 _GLIBCXX_BEGIN_NAMESPACE_VERSION
94 template<
typename _Tp,
typename _Sequence = deque<_Tp> >
98 typedef typename _Sequence::value_type _Sequence_value_type;
99 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
100 __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
101 __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
103 template<
typename _Tp1,
typename _Seq1>
107 template<
typename _Tp1,
typename _Seq1>
112 typedef typename _Sequence::value_type value_type;
113 typedef typename _Sequence::reference reference;
114 typedef typename _Sequence::const_reference const_reference;
115 typedef typename _Sequence::size_type size_type;
116 typedef _Sequence container_type;
127 #ifndef __GXX_EXPERIMENTAL_CXX0X__
129 stack(
const _Sequence& __c = _Sequence())
137 stack(_Sequence&& __c = _Sequence())
138 : c(std::move(__c)) { }
146 {
return c.empty(); }
160 __glibcxx_requires_nonempty();
171 __glibcxx_requires_nonempty();
186 { c.push_back(__x); }
188 #ifdef __GXX_EXPERIMENTAL_CXX0X__
190 push(value_type&& __x)
191 { c.push_back(std::move(__x)); }
193 template<
typename... _Args>
195 emplace(_Args&&... __args)
196 { c.emplace_back(std::forward<_Args>(__args)...); }
213 __glibcxx_requires_nonempty();
217 #ifdef __GXX_EXPERIMENTAL_CXX0X__
239 template<
typename _Tp,
typename _Seq>
242 {
return __x.c == __y.c; }
257 template<
typename _Tp,
typename _Seq>
260 {
return __x.c < __y.c; }
263 template<
typename _Tp,
typename _Seq>
266 {
return !(__x == __y); }
269 template<
typename _Tp,
typename _Seq>
272 {
return __y < __x; }
275 template<
typename _Tp,
typename _Seq>
278 {
return !(__y < __x); }
281 template<
typename _Tp,
typename _Seq>
284 {
return !(__x < __y); }
286 #ifdef __GXX_EXPERIMENTAL_CXX0X__
287 template<
typename _Tp,
typename _Seq>
289 swap(stack<_Tp, _Seq>& __x, stack<_Tp, _Seq>& __y)
292 template<
typename _Tp,
typename _Seq,
typename _Alloc>
293 struct uses_allocator<stack<_Tp, _Seq>, _Alloc>
294 :
public uses_allocator<_Seq, _Alloc>::type { };
297 _GLIBCXX_END_NAMESPACE_VERSION
void push(const value_type &__x)
Add data to the top of the stack.
void pop()
Removes first element.
const_reference top() const
stack(const _Sequence &__c)
Default constructor creates no elements.
A standard container giving FILO behavior.