Boost Coroutine

Coroutines are functions that can yield or relinquish control to another coroutine, and then given control back, resuming from the point at which they earlier yielded. The state of automatic variables is maintained between a yield and the resumption. Coroutines can be used for complex control flow patterns with surprisingly simple and clean code. The Boost Coroutine library provides two types of coroutines:

  • Asymmetric coroutines: Asymmetric coroutines distinguish between a caller and a callee coroutine. With asymmetric coroutines, a callee can only yield back to the caller. They are often used for unidirectional data transfer from either the callee to caller, or the other way.
  • Symmetric coroutines: Such coroutines can yield to other ...

Get Learning Boost C++ Libraries now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.