This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////////////////////////////////////////////////// | |
// This is a minimal example that shows the 4 main building-blocks needed to | |
// write concurrent/async coroutine code. | |
// | |
// 1. A coroutine type that lets users write their coroutine logic | |
// and call and co_await other coroutines that they write. | |
// This allows composition of async coroutine code. | |
// | |
// This example defines a basic `task<T>` type that fulfills this purpose. | |
// |