Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-12-08 21:37:36


Anthony Williams <anthony_w.geo_at_[hidden]> writes:

> Nemanja Trifunovic <nemanja_trifunovic_at_[hidden]> 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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk