Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ZipIterator Class Reference

Iterator that traverses multiple Aleph containers in lockstep. More...

#include <ah-zip.H>

Detailed Description

Iterator that traverses multiple Aleph containers in lockstep.

ZipIterator allows synchronized iteration over two or more containers, producing tuples of corresponding elements at each position.

Iteration stops when ANY underlying iterator reaches its end.

Template Parameters
HeadCType of the first container.
TailCTypes of remaining containers.

Usage example:

DynList<int> ints = {1, 2, 3};
DynList<string> strs = {"a", "b", "c"};
for (auto it = zip_it(ints, strs); it.has_curr(); it.next_ne())
{
auto [i, s] = it.get_curr_ne();
std::cout << i << ": " << s << '\n';
}
ZipIterator< Cs... > zip_it(const Cs &... cs)
Alias for get_zip_it.
Definition ah-zip.H:275
See also
get_zip_it(), zip_it(), EnumZipIterator
Note
This class uses recursive template inheritance (CRTP pattern). The base class is a different specialization: ZipIterator<TailC...>
Author
Leandro Rabindranath Leon

The documentation for this class was generated from the following file: