You should always use the != operator to compare your iterator against end(), instead of operator<, the reason being that the relationship between successful iterators is not always the same as that for plain pointers (i.e. in an array or std::vector, successive elements always have a higher address in memory, so operator< works fine, but this is not always the case).
for (i = whatever.begin(); i != whatever.end(); ++it) ...
EDIT: went and found a source to back me up. From Herb Sutter (http://www.gotw.ca/gotw/073.htm):
"13. Reuse Part 4, or Prefer comparing iterators using !=: When comparing iterators, always use != (which works for all kinds of iterators) instead of < (which works only for random-access iterators), unless of course you really need to use < and only intend to support random-access iterators. The original program uses < to compare the iterators it's given to work on, which is fine for random access iterators, which was the program's initial intent -- to create indexes into vectors and arrays, both of which support random-access iteration. But there's no reason we may not want to do exactly the same thing for other kinds of containers, like lists and sets, that don't support random-access iteration, and the only reason the original code won't work for such containers is that it uses < instead of != to compare iterators."