I am wondering if it's possible to update a callback function to use coroutines. I am using c++20 with MSVC 2019 amd64 16.10. I have a thirdparty C library that registers a callback and I'd like the callback function to get the value and free the caller's thread. I think a coroutine would help here but if a different strategy would be better then I'm all ears.
Code: https://godbolt.org/z/T365MaT8z
Expected: register a callback function and use co_await to wait for the callback to be triggered, get the value
Problem: trying to grasp coroutines and I'm not sure I'm returning the value from the promise_type