Tools.h++ Manual
12-10 104011 Tandem Computers Incorporated
12
For most collections, using member function
apply()
to access every member
is much faster than using an iterator. This is particularly true for the sorted
collections—usually a tree has to be traversed, requiring that the parent of a
node be stored on a stack. Function
apply()
uses the program's stack, while
the sorted collection iterator must maintain its own. The former is much faster.