3

At this answer here on SO, there's a comment suggesting a useful C++ construct, similar to make_zip_iterator, but for ranges: It takes a tuple of ranges and produces a new range - whose begin() and end() iterators are the appropriate zip iterators.

Now, this should not be too difficult to implement, but I was wondering - Isn't already offered already by Boost somehow?

Dev Null
  • 4,731
  • 1
  • 30
  • 46
einpoklum
  • 118,144
  • 57
  • 340
  • 684
  • See http://stackoverflow.com/questions/8511035/sequence-zip-function-for-c11 - I don't know of Boost offering this, but that thread shows you how to use Boost to build it. It'd be nice to have it built in somewhere. – John Zwinck Oct 10 '14 at 00:44

1 Answers1

7

Boost.Range is providing combine() function as zip_iterator's range.

http://www.boost.org/doc/libs/1_56_0/libs/range/doc/html/range/reference/utilities/combine.html

Akira Takahashi
  • 2,912
  • 22
  • 107