Daily bit(e) of C++ | std::views::zip
Daily bit(e) of C++ ♻️116, The C++23 view that produces a "zipped" view over multiple ranges: std::views::zip.
The C++23 std::views::zip produces a zipped view over the adapted ranges. Each element of the resulting view is a tuple-like wrapper containing references to the corresponding element from each input range.
The view will only produce elements that have a corresponding element in all adapted ranges, meaning that the number of elements is dictated by the shortest adapted range.
The view maintains the mutability of the underlying data. When wrapping a mutable range, the corresponding tuple element will be a mutable lvalue reference. When wrapping an immutable range, the corresponding tuple element will be an immutable lvalue reference.