| 74 | // Push an object onto the stack |
| 75 | template <typename T> |
| 76 | void Stack<T>::push(const T& item) |
| 77 | { |
| 78 | Node* node{ new Node{item} }; // Create the new node |
| 79 | node->m_next = m_head; // Point to the old top node |
| 80 | m_head = node; // Make the new node the top |
| 81 | } |
| 82 | |
| 83 | // Pop an object off the stack |
| 84 | template <typename T> |