3 ms·
Is there a way to prevent callback hell in C++ when doing asynchronous communication with C++ before 20? Coroutines seem to be the only clean solution. Promises
by viralsink 2y ago
Is there a way to prevent callback hell in C++ when doing asynchronous communication with C++ before 20? Coroutines seem to be the only clean solution. Promises can work, but they tend to be difficult to reason about if branching is involved.
- darknavi 2y agoTraditionally the way to prevent "callback hell" is to use something like async/await syntax. Without that there aren't a ton of good options. Like you mentioned, you could switch to promises with polling.
- gpderetta 2y agoThere are library-only stackful coroutines options, like in boost.