23 template <
typename T2>
35 void push(
const T& e);
48 template <
typename T2>
51 if ((
void*)
this == (
void*)&op2) {
57 while (!tmp.
empty()) {
58 elems.push_front(tmp.
top());
68 throw std::out_of_range(
"Stack<>::pop(): empty stack");
76 elems.push_back(elem);
83 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.
std::deque< T > elems
Container for the stack elements.
Stack class using vector as element container.
Stack()
Default constructor.
T top() const
Return top element of the stack (but not pop-ing it).