Skip to content

Instantly share code, notes, and snippets.

@HappyCerberus
Created November 30, 2021 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HappyCerberus/8e96c4b57fe959083f86a8bc08fdf076 to your computer and use it in GitHub Desktop.
Save HappyCerberus/8e96c4b57fe959083f86a8bc08fdf076 to your computer and use it in GitHub Desktop.
[Article] C++20 Practical Coroutines - yield
awaitable_handoff yield_value(utils::AwaitableData *data) {
if (data == nullptr)
return awaitable_handoff(std::noop_coroutine());
for (auto &em : emitters_) {
em->notify_departure(data);
}
return awaitable_handoff(data->continuation);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment