itertools

Classes

iterator_facade

iterator_facade<Iter,Value,std::forward_iterator_tag,Reference,Difference>

CRTP base class for various iterator types in itertools.

sentinel_t

Generic sentinel type that can be used to mark the end of a range.

enum_iter

Iterator for an itertools::enumerated range.

enumerated

Represents an enumerated range.

prod_iter

Iterator for a itertools::multiplied (cartesian product) range.

multiplied

Represents a cartesian product of ranges.

range

A lazy range of integers that mimics a Python range.

sliced

Represents a sliced range.

stride_iter

Iterator for a itertools::strided range.

strided

Represents a strided range.

transform_iter

Iterator for a itertools::transformed range.

transformed

Represents a transformed range.

zip_iter

Iterator for a itertools::zipped range.

zipped

Represents a zipped range.

Functions

make_sentinel

Create an itertools::sentinel_t from an iterator using template type deduction.

enumerate

Lazy-enumerate a given range (similar to Python’s enumerate).

product

Lazy-multiply a given number of ranges by forming their cartesian product.

make_product

Create a cartesian product range from an array of ranges.

product_range

Create a cartesian product range of integer ranges from given integers.

foreach

Apply a function to every element of an integer itertools::range.

distance

Calculate the distance between two iterators.

make_vector_from_range

Create a vector from a range.

chunk_range

Given an integer range [first, last), divide it as equally as possible into N chunks.

slice

Lazy-slice a given range.

stride

Lazy-stride through a given range.

transform

Lazy-transform a given range by applying a unary callable object to every element of the original range.

zip

Lazy-zip ranges together (similar to Python’s zip).