14 template <
typename T,
typename CONT = std::deque<T>>
24 template <
typename T2,
typename CONT2>
36 void push(
const T& e);
48 template <
typename T,
typename CONT>
49 template <
typename T2,
typename CONT2>
52 if ((
void*)
this == (
void*)&op2) {
58 while (!tmp.
empty()) {
59 elems.push_front(tmp.
top());
65 template <
typename T,
typename CONT>
68 elems.push_back(elem);
71 template <
typename T,
typename CONT>
75 throw std::out_of_range(
"Stack<>::pop(): empty stack");
80 template <
typename T,
typename CONT>
84 throw std::out_of_range(
"Stack<>::top(): empty stack");
void pop()
Pop element off the stack.
void push(const T &e)
Pushes element onto stack.
Stack< T > & operator=(const Stack< T2 > &rhs)
Assignment of one stack to another.
std::vector< T > elems
Container for the stack elements.
bool empty() const
Check whether stack is empty.
Stack class using vector as element container.
Stack()
Default constructor.
T top() const
Return top element of the stack (but not pop-ing it).