Essential Tools Module User's Guide : Chapter 13 Common Mistakes : Iterators
Iterators
Since the drafting of the ANSI/ISO Standard C++ Library, there are now two kinds of iterators available for use in the Essential Tools Module: the traditional iterators which we describe in detail throughout this manual, and the new “Standard Library” iterators. For more information about using the iterators now mandated by the standard, we refer you to the manual which came with your version of the Standard C++ Library. In this Essential Tools Module manual, unless we specifically say otherwise, an iterator refers to a traditional iterator.
Immediately after construction, the position of an Essential Tools Module iterator is formally undefined. You must advance it or position it before it has a well-defined position. The rule of thumb is “advance and then return.” If the end of the collection has been reached, the return value after advancing will be special, either false or nil, depending on the type of iterator.
Hence, the proper idiom is:
 
RWSlistCollectables ct;
RWSlistCollectablesIterator it(ct);
.
.
.
RWCollectable* c;
while (c=it()) {
// Use c
}