Skip to content

Repository files navigation

iterator — C++20 iterator library (CRTP)

An easy-to-use, header-only C++20 iterator library built on CRTP (Curiously Recurring Template Pattern).

Features

  • CRTP-based iterator base for zero-overhead composable iterators
  • Lazy combinator views: filter, map, chain, zip, enumerate, take, skip, on_each
  • C++20 concepts for iterator constraints (crtp_iterator/concepts.h)
  • Option<T>-style value wrapper (base/Option.h)
  • Collection adapters: array, bounded_range

Example

#include "iterator.h"

auto result = range(0, 10)
    | filter([](int x) { return x % 2 == 0; })
    | map([](int x) { return x * x; });

Build & Test

cmake -B build && cmake --build build
./build/iterator_tests

Requirements

  • C++20 compiler (GCC 11+ / Clang 14+ / MSVC 2022)

License

MIT

About

use c++20 concept implyment iterator

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages