Skip to content

Instantly share code, notes, and snippets.

View piusayowale's full-sized avatar

OGUNLEYE AYOWALE piusayowale

  • Lagos, Nigeria
View GitHub Profile
@lewissbaker
lewissbaker / async_coroutine_example.cpp
Created May 24, 2022 03:58
Implementation of minimal set of components for writing concurrent async coroutine code in C++20.
/////////////////////////////////////////////////////////////////////////
// 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.
//