Iterators
The RWCollectable-based collection classes, and a few other collection classes, have associated iterator classes for iterating over the collection. (Most collection classes now use C++ Standard Library-based iterator methods.) If you use an iterator class, be aware of the following issue.
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
}