
Anthony Williams <anthony_w.geo@yahoo.com> writes:
Nemanja Trifunovic <nemanja_trifunovic@yahoo.com> writes:
Just because the vast majority of sequences will be random access doesn't mean we should limit ourselves to that, when it is so easy to allow the use of Forward Iterators.
Bidirectional maybe, but using a forward iterator would break some important functionality: for instance, if an invalid sequence is detected, we step back to the beginning of the sequence before reporting the error.
Forward Iterators are copyable, so you can do this by keeping a copy of the beginning of the sequence, and returning that on error.
Yeah, I *hope* you'd do the same with bidirectional iterators. -- Dave Abrahams Boost Consulting www.boost-consulting.com