Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-07-26 12:28:02


"Llew Sion Goodstadt" <leo.goodstadt_at_[hidden]> writes:

>> Doesn't seem like such a great idea to me. It forces you to pay at
>> each iteration of a loop when you could pay once to ensure that your
>> ending zip iterator is formed from the correct position in each
>> sequence. In my opinion the zip_iterator documentation should be
>> improved (quite a lot) to make the requirements more explicit.
>
> For iterators over a container, that is indeed true. In which case,
> surely it would be better to provide a constructor which calculates
> the minimum distance rather than relying on the user to remember to
> check beforehand.

These are iterators, not sequences. It is not appropriate to build
length calculations into the construction of a single iterator. The
right place for this sort of functionality would be in a library of
sequence views.

-- 
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