Thank you very much, Toby Speight! I really appreciate your review — it’s been quite a while since I last wrote any C++. I’ve applied most of your suggestions to my repository: https://github.com/mausys/coroutine-cpp
, except for the variant/visit part. I looked it up in the reference, but it looks confusing to me. I used std::variant in combination with the std::get_if method.
I also discovered a bug in my code: I mistakenly used queue::backqueue::back instead of queue::frontqueue::front when recycling the indices.