Tools.h++ Class Reference

Table Of Contents
Persistence
None
Example
In this example a stack of ints, implemented as an ordered vector, is exercised.
#include <rw/tstack.h>
#include <rw/tvordvec.h>
#include <rw/rstream.h>
main() {
RWTStack<int, RWTValOrderedVector<int> > stack;
stack.push(1);
stack.push(5);
stack.push(6);
while (!stack.isEmpty())
cout << stack.pop() << endl;
return 0;
}
Program output:
6
5
1
Public Member Functions
void
clear();
Removes all items from the stack.
size_t
entries() const;
Returns the number of items currently on the stack.
RWBoolean
isEmpty() const;
Returns TRUE if there are currently no items on the stack, FALSE otherwise.
void
push(T a);