User's Guide to the GNU C++ Class Library
Stacks are declared as an ``abstract'' class. They are currently implemented in any of three ways.
VStack
XPStack
SLStack
All possess the same capabilities. They differ only in constructors. VStack constructors require a fixed maximum capacity argument. XPStack constructors optionally take a chunk size argument. SLStack constructors take no argument.
Assume the declaration of a base element x.
Stack s; or Stack s(int capacity)
s.empty()
s.full()
s.length()
s.push(x)
x = s.pop()
s.top()
s.del_top()
top() to inspect and use
the top of stack, followed by a del_top()
s.clear()