We already have QCoroFuture::waitForFinished(), which is an async version of QFuture::waitForFinished() (but also returns the result, unlike QFuture::waitForFinished) - it's basically a combination of QFuture::waitForFinished() + QFuture::result()).
In Qt 6 there's also QFuture::takeResult() which moves the result from the QFuture to the caller. This change introduces QCoroFuture::takeResult(), which is an asynchronous equivalent to QFuture::waitForFinished() + QFuture::takeResult()).
To make the API more symmetrical, this change also introduces QCoroFuture::result(), which is equivalent to waitForFinished(), but it's now clearer that result() returns copy, while takeResult() moves (like their QFuture counterparts). waitForFinished() is still available but discouraged for newly written code in favor of result() (or directly co_awaiting on QFuture object).
We already have QCoroFuture::waitForFinished(), which is an async version of QFuture::waitForFinished() (but also returns the result, unlike QFuture::waitForFinished) - it's basically a combination of QFuture::waitForFinished() + QFuture::result()).
In Qt 6 there's also QFuture::takeResult() which moves the result from the QFuture to the caller. This change introduces QCoroFuture::takeResult(), which is an asynchronous equivalent to QFuture::waitForFinished() + QFuture::takeResult()).
To make the API more symmetrical, this change also introduces QCoroFuture::result(), which is equivalent to waitForFinished(), but it's now clearer that result() returns copy, while takeResult() moves (like their QFuture counterparts). waitForFinished() is still available but discouraged for newly written code in favor of result() (or directly co_awaiting on QFuture object).