Qt 6.0 added QFuture::takeResult which allows using move only types with futures, as long as you only get the result once. QCoroFuture uses result, which I believe is the correct default, but I would like a way to opt into using the move version.
As a hack I just took QCoroFuture and modified it a bit, and this works great. Maybe something like co_await QCoroFutureOnce(future) would work, or maybe co_await qCoro(future).moveable().
Qt 6.0 added
QFuture::takeResult
which allows using move only types with futures, as long as you only get the result once.QCoroFuture
usesresult
, which I believe is the correct default, but I would like a way to opt into using the move version.As a hack I just took
QCoroFuture
and modified it a bit, and this works great. Maybe something likeco_await QCoroFutureOnce(future)
would work, or maybeco_await qCoro(future).moveable()
.