5 ms·
Ah, you're right, I missed it because it's callee-controlled in C++. (See Heap Allocation and Promise on https://en.cppreference.com/w/cpp/language/coroutines h
by Tamschi 4y ago
Ah, you're right, I missed it because it's callee-controlled in C++.
(See Heap Allocation and Promise on https://en.cppreference.com/w/cpp/language/coroutines https://en.cppreference.com/w/cpp/language/coroutines , for those curious.)
Rust coroutines evaluate to opaque value types instead of handles, for comparison, so the caller gets to decide what to do with them.
Currently they're a bit unwieldy though, until naming (aliasing) their types becomes possible. The unstable documentation for that is here: https://rust-lang.github.io/impl-trait-initiative/explainer/tait.html https://rust-lang.github.io/impl-trait-initiative/explainer/...
(Edit: Sorry, I'd grabbed the wrong second link. Fixed.)