Tools.h++ Class Reference

Table Of Contents
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
RWTStack<T,C>
Synopsis
Description
Persistence
Example
Public Member Functions
Synopsis
#include <rw/tstack.h>
RWTStack<T, C> stack;
Description
This class maintains a stack of values. Not only can the type of object inserted onto the stack be
parameterized, but also the implementation of the stack.
Parameter T represents the type of object in the stack, either a class or built in type. The class T
must have:
well-defined copy semantics (T::T(const T&) or equiv.);
well-defined assignment semantics (T::operator=(const T&) or equiv.);
any other semantics required by class C.
Parameter C represents the class used for implementation. Useful choices are
RWTValOrderedVector<T> or RWTValDlist<T>. Class RWTValSlist<T> can also be used, but
note that singly-linked lists are less efficient at removing the last item of a list (function pop()),
because of the necessity of searching the list for the next-to-the-last item.