Skip to content

Glossary: Software Design Patterns in C++

Generator

Also written: std::generator

A function that hands back one item, then pauses until asked for the next. C++20 has none (`std::generator` arrives in C++23), so a lazy view is the nearest tool.

Where the book teaches it

Related terms

ViewIterator