35 void push(
const T& value) {
42 throw "Stack is empty";
45 if (data.getSize() > 0) {
49 throw "Stack is empty";
56 throw "Stack is empty";
58 return data[data.getSize() - 1];
61 const T&
top()
const {
63 throw "Stack is empty";
65 return data[data.getSize() - 1];
69 return data.getSize() == 0;
73 return data.getSize();
Implements a dynamic array-like list for storing and managing a collection of elements.
void pop()
Removes the top element; throws if empty.
T & top()
Top element without removing it; throws if empty.
void push(const T &value)
Pushes value onto the top of the stack.
Root namespace for everything the engine exposes.