24template<
typename T>
class Stack {
74 if (pos >=
stack_.size()) std::cerr <<
"WARNING: Looking outside stack\n";
85 if (pos >=
stack_.size()) std::cerr <<
"WARNING: Looking outside stack\n";
Stack class based on a deque.
Definition: Stack.h:24
T & Peek()
Return the topmost item on the stack without removing it.
Definition: Stack.h:58
const T & PeekPos(size_t pos) const
Gets item on a specified stack position without removing it.
Definition: Stack.h:84
void Push(const T &item)
Push an item onto the stack.
Definition: Stack.h:40
T Pop()
Pop an item from the stack and return it.
Definition: Stack.h:47
bool IsEmpty() const
Returns whether or not the stack is empty.
Definition: Stack.h:33
const T & Peek() const
Return the topmost item on the stack without removing it.
Definition: Stack.h:65
T & PeekPos(size_t pos)
Gets item on a specified stack position without removing it.
Definition: Stack.h:73
std::deque< T > stack_
The stack.
Definition: Stack.h:94