# ryanhaining/cppitertools

Implementation of python itertools and builtin iteration functions for C++17

Repository: https://github.com/ryanhaining/cppitertools
Canonical: https://ross.abutalabs.com/products/cppitertools
Homepage: https://twitter.com/cppitertools
Language: C++
License: BSD-2-Clause
License Family: permissive
Last push: 2025-12-07T05:47:01+00:00

## Health v2 (maintenance only)
Score: 48/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 56, release rhythm 9, longevity 100
- inputs: {"age_days": 4737, "days_push": 269, "days_rel": 394, "gap_med": 186, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1430, forks 124 (observed 2026-08-28T04:04:42.289748+00:00)

## What it is
A header-only C++17 library that ports Python's itertools and built-in iteration functions (range, enumerate, zip, groupby, combinations, etc.) to C++ range-based for loops. It uses lazy evaluation and works with standard iterators without copying underlying elements.

## Use cases
- use python-style enumerate and zip in C++ loops
- generate permutations and combinations in C++
- chunk or batch a container into groups
- lazily filter and transform sequences in C++
- implement sliding window over a range
- group elements by a key like itertools.groupby

## When to choose
- you want Python-like iteration ergonomics in modern C++
- you need a dependency-light, header-only iterator utility library
- you want lazy evaluation to avoid materializing intermediate containers

## When to avoid
- you need zip_longest without a Boost dependency
- your codebase targets pre-C++17 compilers
- you need parallel or coroutine-based iteration pipelines

## Facets
- artifact type: library
- maturity: stable
- function: developer-tools
- domain: developer-tools
- platform: cpp, cross-platform
- tags: header-only, itertools, lazy-evaluation, range-based-for, python-inspired, iterators, algorithms

## Member repositories
- ryanhaining/cppitertools (main) score 48

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:42.289748+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:37:13.117487+00:00, confidence not recorded.
  - readme: https://github.com/ryanhaining/cppitertools (fetched 2026-08-28T04:04:42.289748+00:00, sha 78d913189d95)
- Data as of 2026-08-30T08:39:29.467469+00:00.
