tl-generator

[full]

ranges-compatible generator type built on C++20 coroutines

Single-header, ranges-compatible generator type built with C++20 coroutines.

Documentation Status

A generator allows implementing sequence producers which are terse and avoid creating the whole sequence in memory.

For example, if you were to need a sequence of the first n integers, you could generate a std::vector of them. This implementation would be simple, but would have to produce the whole sequence in memory. To avoid this, you could instead write an iterator or range which generates them lazily. However, writing iterators and ranges comes with a lot of boilerplate. Generators have the benefits of both:

... More
license CC0-1.0 Universal
project tl
doc-url tl.tartanllama.xyz/en/latest/
1 Version
version 0.4.0
repository https://pkg.cppget.org/1/alpha
depends 0
requires 1; c++ >= 20