Skip to main content

Practice ยท 1 of 1

A Consuming take() Adapter

With your Generator<T> intact, implement take(Generator<int> src, int n) โ€” a **move-only** function returning a Generator that yields at most n values from src. This grades the ownership rule: the adapter must own src by move.

Difficulty: advanced

Back to lesson: Practice: Coroutine Lifetime Clinic