STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Protected Attributes | List of all members
stack< _Ty, _Container > Class Template Reference

Public Types

typedef stack< _Ty, _Container > _Myt
 
typedef _Container container_type
 
typedef _Container::value_type value_type
 
typedef _Container::size_type size_type
 
typedef _Container::reference reference
 
typedef _Container::const_reference const_reference
 

Public Member Functions

 stack ()
 
 stack (const _Container &_Cont)
 
template<class _Alloc , class = typename enable_if<uses_allocator<_Container, _Alloc>::value, void>::type>
 stack (const _Alloc &_Al)
 
template<class _Alloc , class = typename enable_if<uses_allocator<_Container, _Alloc>::value, void>::type>
 stack (const _Myt &_Right, const _Alloc &_Al)
 
template<class _Alloc , class = typename enable_if<uses_allocator<_Container, _Alloc>::value, void>::type>
 stack (const _Container &_Cont, const _Alloc &_Al)
 
 stack (_Container &&_Cont)
 
template<class _Alloc , class = typename enable_if<uses_allocator<_Container, _Alloc>::value, void>::type>
 stack (_Myt &&_Right, const _Alloc &_Al)
 
template<class _Alloc , class = typename enable_if<uses_allocator<_Container, _Alloc>::value, void>::type>
 stack (_Container &&_Cont, const _Alloc &_Al)
 
void push (value_type &&_Val)
 
template<class... _Valty>
void emplace (_Valty &&..._Val)
 
bool empty () const
 
size_type size () const
 
reference top ()
 
const_reference top () const
 
void push (const value_type &_Val)
 
void pop ()
 
const _Container & _Get_container () const
 
void swap (_Myt &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Container >
 

Protected Attributes

_Container c
 

Member Typedef Documentation

template<class _Ty, class _Container = deque<_Ty>>
typedef stack<_Ty, _Container> stack< _Ty, _Container >::_Myt
template<class _Ty, class _Container = deque<_Ty>>
typedef _Container::const_reference stack< _Ty, _Container >::const_reference
template<class _Ty, class _Container = deque<_Ty>>
typedef _Container stack< _Ty, _Container >::container_type
template<class _Ty, class _Container = deque<_Ty>>
typedef _Container::reference stack< _Ty, _Container >::reference
template<class _Ty, class _Container = deque<_Ty>>
typedef _Container::size_type stack< _Ty, _Container >::size_type
template<class _Ty, class _Container = deque<_Ty>>
typedef _Container::value_type stack< _Ty, _Container >::value_type

Constructor & Destructor Documentation

template<class _Ty, class _Container = deque<_Ty>>
stack< _Ty, _Container >::stack ( )
inline
30  : c()
31  { // construct with empty container
32  }
_Container c
Definition: stack:137
template<class _Ty, class _Container = deque<_Ty>>
stack< _Ty, _Container >::stack ( const _Container &  _Cont)
inlineexplicit
35  : c(_Cont)
36  { // construct by copying specified container
37  }
_Container c
Definition: stack:137
template<class _Ty, class _Container = deque<_Ty>>
template<class _Alloc , class = typename enable_if<uses_allocator<_Container, _Alloc>::value, void>::type>
stack< _Ty, _Container >::stack ( const _Alloc &  _Al)
inlineexplicit
43  : c(_Al)
44  { // construct with allocator
45  }
_Container c
Definition: stack:137
template<class _Ty, class _Container = deque<_Ty>>
template<class _Alloc , class = typename enable_if<uses_allocator<_Container, _Alloc>::value, void>::type>
stack< _Ty, _Container >::stack ( const _Myt _Right,
const _Alloc &  _Al 
)
inline
51  : c(_Right.c, _Al)
52  { // construct by copying specified container
53  }
_Container c
Definition: stack:137
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Ty, class _Container = deque<_Ty>>
template<class _Alloc , class = typename enable_if<uses_allocator<_Container, _Alloc>::value, void>::type>
stack< _Ty, _Container >::stack ( const _Container &  _Cont,
const _Alloc &  _Al 
)
inline
59  : c(_Cont, _Al)
60  { // construct by copying specified container
61  }
_Container c
Definition: stack:137
template<class _Ty, class _Container = deque<_Ty>>
stack< _Ty, _Container >::stack ( _Container &&  _Cont)
inlineexplicit
64  : c(_STD move(_Cont))
65  { // construct by moving specified container
66  }
_Container c
Definition: stack:137
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Ty, class _Container = deque<_Ty>>
template<class _Alloc , class = typename enable_if<uses_allocator<_Container, _Alloc>::value, void>::type>
stack< _Ty, _Container >::stack ( _Myt &&  _Right,
const _Alloc &  _Al 
)
inline
72  : c(_STD move(_Right.c), _Al)
73  { // construct by moving specified container
74  }
_Container c
Definition: stack:137
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Ty, class _Container = deque<_Ty>>
template<class _Alloc , class = typename enable_if<uses_allocator<_Container, _Alloc>::value, void>::type>
stack< _Ty, _Container >::stack ( _Container &&  _Cont,
const _Alloc &  _Al 
)
inline
80  : c(_STD move(_Cont), _Al)
81  { // construct by moving specified container
82  }
_Container c
Definition: stack:137
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349

Member Function Documentation

template<class _Ty, class _Container = deque<_Ty>>
const _Container& stack< _Ty, _Container >::_Get_container ( ) const
inline
126  { // get reference to container
127  return (c);
128  }
_Container c
Definition: stack:137
template<class _Ty, class _Container = deque<_Ty>>
template<class... _Valty>
void stack< _Ty, _Container >::emplace ( _Valty &&...  _Val)
inline
91  { // insert element at beginning
92  c.emplace_back(_STD forward<_Valty>(_Val)...);
93  }
_Container c
Definition: stack:137
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Container = deque<_Ty>>
bool stack< _Ty, _Container >::empty ( ) const
inline
96  { // test if stack is empty
97  return (c.empty());
98  }
_Container c
Definition: stack:137
template<class _Ty, class _Container = deque<_Ty>>
void stack< _Ty, _Container >::pop ( )
inline
121  { // erase last element
122  c.pop_back();
123  }
_Container c
Definition: stack:137
template<class _Ty, class _Container = deque<_Ty>>
void stack< _Ty, _Container >::push ( value_type &&  _Val)
inline
85  { // insert element at beginning
86  c.push_back(_STD move(_Val));
87  }
_Container c
Definition: stack:137
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Container = deque<_Ty>>
void stack< _Ty, _Container >::push ( const value_type _Val)
inline
116  { // insert element at end
117  c.push_back(_Val);
118  }
_Container c
Definition: stack:137
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Container = deque<_Ty>>
size_type stack< _Ty, _Container >::size ( ) const
inline
101  { // test length of stack
102  return (c.size());
103  }
_Container c
Definition: stack:137
template<class _Ty, class _Container = deque<_Ty>>
void stack< _Ty, _Container >::swap ( _Myt _Right)
inline
132  { // exchange contents with _Right
133  _Swap_adl(c, _Right.c);
134  }
_Container c
Definition: stack:137
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:73
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Ty, class _Container = deque<_Ty>>
reference stack< _Ty, _Container >::top ( )
inline
106  { // return last element of mutable stack
107  return (c.back());
108  }
_Container c
Definition: stack:137
template<class _Ty, class _Container = deque<_Ty>>
const_reference stack< _Ty, _Container >::top ( ) const
inline
111  { // return last element of nonmutable stack
112  return (c.back());
113  }
_Container c
Definition: stack:137

Member Data Documentation

template<class _Ty, class _Container = deque<_Ty>>
_Container stack< _Ty, _Container >::c
protected

The documentation for this class was generated from the following file: