Boost logo

Boost :

From: Nemanja Trifunovic (nemanja_trifunovic_at_[hidden])
Date: 2006-12-14 08:10:46

David Abrahams <dave <at>> writes:

> Anthony Williams <anthony_w.geo <at>> writes:
> > Nemanja Trifunovic <nemanja_trifunovic <at>> writes:
> >
> >>> Just because the vast majority of sequences will be random access
> >> 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
> >> functionality: for instance, if an invalid sequence is detected, we step
> >> 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.

Sorry for the late answer.

Not in this case. "Stepping back" occurs only in case of an invalid UTF-8
sequence which is an exceptional case. If we decide to keep a copy of the
iterator, we would need to do it for each function call.

Boost list run by bdawes at, gregod at, cpdaniel at, john at