Build a Zip Iterator Adapter
Learn to build a zip iterator adapter.
We'll cover the following...
Many
Let's consider the scenario of two sequences—they can be containers, iterators, or initialization lists.
We want to zip them together to make a new sequence with pairs of elements from the first two sequences:
In this recipe we will accomplish this task with an iterator adapter.
How to do it
In this recipe we’ll build a zip iterator adapter that takes two containers of the same type and zips the values into std::pair
objects:
In our
main()
function we ...