Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.7.2
-
None
Description
While QFuture is generally designed to support move-only types, using unwrap() on a (nested) future holding a move-only type fails to compile. The code inside QFuture::unwrap() is quite clear in its expectation of the result type copyability:
// ...
nestedFuture.then([promise] (const QFuture<NestedType> &nested) mutable { // <- passing `nested` by const&
// ...
{
if constexpr (!std::is_void_v<NestedType>)
promise.reportResults(nested.results()); // <- calling results() that copies the stored QList
}
Though QFuture::takeResults() to move the entire underlying QList might be too much to add (might it?), at least unwrap() could make a new QList and std::move() each result in that new list if it detects move-only result type.
Attachments
Issue Links
- is blocked by
-
QTBUG-106593 QList: support move-only types
- Reported