On Sat, 09 May 2009 12:40:34 -0400, Michel Fortin <michel.for...@michelf.com> wrote:

On 2009-05-09 10:45:05 -0400, "Steven Schveighoffer" <schvei...@yahoo.com> said:

STL iterators can be used for more than just iteration. They also serve as cursors, or pointers to specific elements. If you add the ability for them to check their own bounds, then they become as safe as ranges, and can be used as general purpose pointers for things like insertion, deletion, bi-directional traversal, things that ranges can do but are clumsy at. You still have the interchangable-with-pointer concept burned into your brain :)
 Think more like this:
 for(cursor i = begin; !i.end; i++)

So basically your cursor is a range (so it knows its bounds) with an added position pointer.

Basically, yes.

-Steve

Reply via email to