Pure C++20 coroutine example demonstrating how one coroutine can yield from another.
$ g++ -v
g++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
$ g++ --std=c++20 -fcoroutines -g example.cpp
$ ./a.out
main_counter yields 0
main[0] =>0
main_counter yields 1
main[1] =>1
main_counter yields 2
main[2] =>2
Begin yield_from
Other_counter yields 100
main[3] =>100
Other_counter yields 101
main[4] =>101
Other_counter yields 102
main[5] =>102
Other_counter yields 103
main[6] =>103
Other_counter yields 104
main[7] =>104
All done with yield_from
main_counter yields 3
main[8] =>3
main_counter yields 4
main[9] =>4