Results 125 comments of Lewis Baker

Coroutines have not yet been adopted into the C++ draft standard, but I'm still hopeful they will be for C++20 :) See this cppreference page for the reference to the...

@ddosoff You can use Compiler Explorer to compile cppcoro examples. You just need to enable the cppcoro library in the “Libraries” drop down. Alternatively check out the cppcoro repository locally...

> Interesting to compare the amount of code (and complexity) in the C++ version of an async event and the C# one. Why does it have to be so complex...

@insoulity The compiler translation for the symmetric-transfer version of `await_suspend()` is pretty straight forward: ``` // ... etc. as for other variants. if (!awaiter.await_ready()) { // suspend-point awaiter.await_suspend(coroutine_handle::from_promise(promise)).resume(); // return-to-caller-or-resumer...

@subbota-a Yes, the implementation of `async_manual_reset_event` will resume all awaiting consumers on the thread that calls `event.set()` inside the call to `set()`. A future enhancement might require the awaiting coroutine...

@martinbonaciugome Yes, I think technically if get_awaitable() and/or get_awaiter() returns a prvalue then the lifetime of those objects will extend to the end of the full-expression, rather than their lifetimes...

See also discussion thread on [/r/cpp](https://www.reddit.com/r/cpp/comments/giisb6/c_coroutines_understanding_symmetric_transfer/)

@kghost Yes, coroutines will be able to help you write functions like this more easily. That is one of their primary use-cases. Instead of passing the continuation in as a...

The coroutine is not considered suspended until execution reaches the await_suspend() method. So it is undefinded behaviour if you try to destroy() it before that. E.g. in the final_suspend() method.