|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2005-07-26 10:37:13
Leo Goodstadt <leo.goodstadt_at_[hidden]> writes:
> The zip iterator documentation says:
> "The zip iterator provides the ability to parallel-iterate over several
> controlled sequences simultaneously. ...
> Moving the zip iterator moves all the iterators in parallel."
>
> What is not specified is what happens when the several different
> sequences are of unequal size.
> At the moment, everything just blows up.
>
> python zip, if I remember correctly, just stops at the end of the
> shortest sequence in the tuple. (python map works differently).
> This seems a sensible thing to do.
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.
-- 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