Generator vs Suspend

79 Views Asked by At

In C++23, with the generator introduced, C++ starts to support coroutine. So a function can be paused and resumed. However, Kotlin does not have a concept of the generator, instead, it has conceptions like Coroutine Scoep/Context, Dispatchers, and suspends. Does the C++ and Kotlin Coroutine achieve the same goal using different syntax? Or are there some fundamental differences between those coroutine implementations?

0

There are 0 best solutions below