Hacker News new | ask | show | jobs
by IshKebab 634 days ago
Yeah there aren't many good resources on it unfortunately. One thing to note is C++20's coroutine support is really low level. It's designed for library authors so that they can build the kinds of things "normal" people want - tasks, generators, futures, promises, etc.

This video is the best intro I've found. It actually explains what is happening in memory, which is the only way to really understand anything in C++.

https://youtu.be/aibjUHx7vew

Also this is decent:

https://www.scs.stanford.edu/~dm/blog/c++-coroutines.html

But don't try and write a coroutine library yourself. Use something like libcoro.