Boost logo

Boost :

Subject: [boost] [iterator] zip_iterator equality comparison
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2009-07-05 16:10:03


It is standard in STL to have two ranges that are zipped together (such as
in the two-input-sequence version of std::transform at
http://www.sgi.com/tech/stl/transform.html) where the first range has
begin and end iterators and other ranges have only begin iterators.
However, boost::zip_iterator does not support this capability because it
compares all iterators in the iterator tuple. Therefore, it is not
possible to write std::transform on two sequences by using a zip_iterator
to join the sequences. Allowing this by only comparing the first elements
in the iterator tuples would simplify the code for zip_iterator, although
it would no longer allow the zipping of zero sequences unless that was
special-cased. Is this a reasonable feature to allow? I could probably
put together a patch for it in the next few days if people wanted it.

-- Jeremiah Willcock


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