2 ms·
Ask HN: Were C++20 coroutines the best approach for stackless coroutines?
- germandiago 3y agoI keep looking at that paper and wondering about the advantages and disadvantages of the adopted approach vs the one in the paper. Does anyone have more insights? - The paper uses the `resumable` keyword. Meaning that you have to use `resumable` in each function prototype when no deduction can be done. - You have to mark as `resumable` the evaluation mode. - There is no viral `co_await` all the chain up. - There is `resumable` deduction. This makes the standard library templates, for example, reusable and convertible to `resumable` by injecting your `resumable` function/iterator/whatever. - It seems to be easier (correct me if I am wrong) to calculate the space needed for a coroutine? - If follows something much closer to a function-object approach.