Hacker News new | ask | show | jobs
by andreidd 1221 days ago
Not entirely true. You can pool allocate a C++ coro.
1 comments

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 , 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/...

(Edit: Sorry, I'd grabbed the wrong second link. Fixed.)