5 ms·
Not entirely true. You can pool allocate a C++ coro.
by andreidd 4y ago
Not entirely true. You can pool allocate a C++ coro.
- Tamschi 4y agoAh, 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.)