You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new recursive_generator<T> type that allows for efficient enumeration over a sequence that is defined recursively.
This type would allow you to pass either a T or a recursive_generator<T> to the co_yield expression.
The increment operator on the iterator would then directly resume the leaf-most coroutine rather than the having to resume each coroutine in the stack until the leaf is resumed and then later suspend every coroutine on the stack for each item.
The iteration should be cancellable at any point by simply destructing the owning recursive_generator<T> object. This should in turn destruct all nested coroutine frames recursively as the automatic variables within each coroutine fame, which should include the recursive_generator for the nested sequence, are destructed as the coroutine is destroyed.
Add a new
recursive_generator<T>
type that allows for efficient enumeration over a sequence that is defined recursively.This type would allow you to pass either a
T
or arecursive_generator<T>
to theco_yield
expression.The increment operator on the iterator would then directly resume the leaf-most coroutine rather than the having to resume each coroutine in the stack until the leaf is resumed and then later suspend every coroutine on the stack for each item.
eg.
The text was updated successfully, but these errors were encountered: