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

Iterator that traverses multiple containers with enumeration index. More...

#include <ah-zip.H>

Detailed Description

Iterator that traverses multiple containers with enumeration index.

Like ZipIterator, but appends the current index as the last element in each tuple. Useful when you need both the position and values.

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

Usage example:

DynList<int> ints = {10, 20, 30};
DynList<std::string> strs = {"a", "b", "c"};
for (auto it = enum_zip_it(ints, strs); it.has_curr(); it.next_ne())
{
auto t = it.get_curr_ne();
// t is std::tuple<int, string, size_t> where last element is the index
std::cout << std::get<2>(t) << ": " << std::get<0>(t) << '\n';
}
EnumZipIterator< Cs... > enum_zip_it(const Cs &... cs)
Alias for get_enum_zip_it.
Definition ah-zip.H:1323
See also
get_enum_zip_it(), enum_zip_it(), ZipIterator

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