Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.1.2
-
None
-
-
8
-
642b9fce81b46e23b35b17e8284bd81bdba57fdd (qt/qtbase/dev) b91311c8bfa30ec02afb8027befff8943c8ff197 (qt/qtbase/6.2) 4d942551492378adaddca55cb1a48c11e7ec6a3a (qt/qtbase/6.1)
-
Qt6_Foundation_Sprint 40
Description
The issue is as simple as
class X { public: X(int) { } }; void f() { QFuture<X> x = QtConcurrent::run([]{ return X(0); }); }
It fails with a very long error message! In there we can find
error: use of deleted function ‘QtConcurrent::RunFunctionTask<X>::RunFunctionTask()" ... "error: no matching function for call to ‘X::X()"
Apparently, QtConcurrent::run wants to save the lambdas' return value in a member and later assign it, but if the value is not default constructible, that won't work!
Attachments
For Gerrit Dashboard: QTBUG-95214 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
365391,5 | QtConcurrent::run: support non default-constructible return types | dev | qt/qtbase | Status: MERGED | +2 | 0 |
365484,2 | QtConcurrent::run: support non default-constructible return types | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
365485,2 | QtConcurrent::run: support non default-constructible return types | 6.1 | qt/qtbase | Status: MERGED | +2 | 0 |