"Andrew" <ha****@ureach.com> wrote in message
news:11**************************@posting.google.c om...
Since stack does not provide iterator interfaces, how to iterate
over it (e.g., print out each element in it for debug purpose)
without changing its structure or copying the whole stack to another stack
for such purpose?
A stack is just a thin wrapper around another container. The point of
using a stack is to make your code self-documentating --to emphasize
that you don't need to use the other operations supported by the
underlying container. So if this last condition is not satisfied,
there's no reason to use a stack.
Jonathan