cpp/coroutine/generator

@1@ The class template presents a  of the elements yielded by the evaluation of a.

@2@ Convenience alias template for the using the polymorphic allocator.

A generates a sequence of elements by repeatedly resuming the coroutine from which it was returned. Each time a statement is evaluated, the coroutine produces one element of the sequence. When the statement is of the form, each element of the   is successively produced as an element of the sequence.

models and.

The behavior of a program that adds a specialization for is undefined.

Data members
Internally, each active instance of is associated with a stack.


 * When is called, a new stack is created and the generator is added to the stack.
 * When is evaluated in a generator body,  is converted to a generator and added to the stack that contains the enclosing generator.
 * When a generator iterator is, the coroutine at the top of the associated stack is resumed.
 * When a generator finishes (i.e. when is called), it is removed from the stack.

Template parameters
If is not, then:
 * is a pointer type;
 * meets the requirements.

Member types
Let denote:
 * , if is a reference type, and
 * otherwise.

The following concepts are modeled:
 * , and
 * , and