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?

1

1 Answer 1

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

2
  • ... and will it work with C++11 range-based for loops, or do I need to stick to BOOST_FOREACH ?
    – einpoklum
    Commented Oct 10, 2014 at 13:52
  • 2
    You can apply to both (range-based for and BOOST_FOREACH). Commented Oct 14, 2014 at 3:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.