Skip to content

Instantly share code, notes, and snippets.

View aliabbas299792's full-sized avatar

Ali aliabbas299792

View GitHub Profile
@aliabbas299792
aliabbas299792 / coroutine_example.cpp
Last active December 23, 2023 01:44
An annotated example of how to use coroutines within coroutines
#include <atomic>
#include <coroutine>
#include <iostream>
#include <thread>
#include <vector>
/*
The idea of this snippet is as such:
> coro1 does some stuff then co_await coro2
> coro2 does some more stuff and co_await coro3