Open danvratil opened 1 year ago
It seems to me that QCoro::Task is capable of completing itself, and even auto-magically handles destruction of its coroutine handle. I get it that in async context a Task likely should be awaited; but in a non-async function which is your entry point to call a coroutine, getting a Task object is not very useful, and would probably be discarded (while the actual coroutine runs to completion on its own). So, what would you suggest doing in the second situation? Storing a task in a dummy variable? casting it to void?
By annotating the right methods with
[[nodiscard]]
users should get-Wunused-result
warning from compiler when they invoke a coroutine but don't store or co_await the returnedTask
.