TRIQS/itertools 1.3.0
C++ range library
Loading...
Searching...
No Matches
Range iterators

Detailed Description

Range iterators are internally used by the library to iterate over Adapted ranges.

In general, there should be no need for users to deal with range iterators directly. Instead, it is recommended to use range-based for loops, e.g.

for (auto [idx, val] : itertools::enumerate(some_range)) {
// do something with the index and the value of the range
}
enumerated< R > enumerate(R &&rg)
Lazy-enumerate a given range (similar to Python's enumerate).

vs. the traditional for loops, e.g.

auto enum_range = itertools::enumerate(some_range);
for (auto it = enum_range.begin(); it != enum_range.end(); ++it) {
// do something with the iterator
}

Classes

struct  itertools::enum_iter< Iter >
 Iterator for an itertools::enumerated range. More...
 
struct  itertools::prod_iter< EndIters, Iters >
 Iterator for a itertools::multiplied (cartesian product) range. More...
 
struct  itertools::stride_iter< Iter >
 Iterator for a itertools::strided range. More...
 
struct  itertools::transform_iter< Iter, F, Value >
 Iterator for a itertools::transformed range. More...
 
struct  itertools::zip_iter< Iters >
 Iterator for a itertools::zipped range. More...