|
Data Structures & Algorithms in C++
Goodrich, Tamassia, Mount and Goldwasser
|
A simplified version of the STL stack class. More...
#include <stack.h>

Public Member Functions | |
| int | size () const |
| return the number of elements currently in the stack | |
| bool | empty () const |
| return whether the stack is currently empty | |
| const T & | top () const |
| return const reference to the top element of the stack | |
| T & | top () |
| return live (non-const) reference to the top element of the stack | |
| void | push (const T &elem) |
| add an element to the top of the stack | |
| void | pop () |
| remove the top element from the stack | |
A simplified version of the STL stack class.
|
inline |
return whether the stack is currently empty
|
inline |
remove the top element from the stack
|
inline |
add an element to the top of the stack
|
inline |
return the number of elements currently in the stack
|
inline |
return live (non-const) reference to the top element of the stack
|
inline |
return const reference to the top element of the stack