In this article, we’ll look at a super handy ranges view in C++23 - views::zip. In short, it allows you to combine two or more ranges and iterate through them simultaneously. Let’s see how to use it.
Basic If you have two (or more) separate containers and you want to iterate through them “in parallel,” you can write the following code: