qt5base-lts/tests/auto/corelib/thread/qfuture
Sona Kurazyan 3be72253a6 Fix QFuture continuations/handlers to work with move-only callables
std::function, which is used to store the type-erased continuation
lambdas, requires the passed callable to be copy-constructible. This
makes impossible to use move-only callables with continuations/handlers.
In particular, it makes impossible passing lambdas that are capturing
move-only objects. The workaround is to store the continuation lambda
inside a wrapper for the callable, which stores the move-only lambda in
a QSharedPtr and can be stored in std::function, since it's copyable.

Pick-to: 6.2
Fixes: QTBUG-98493
Change-Id: I8b7a22fcf68dc132b3c533216a7a1665e9f9fb0a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-12-01 01:58:18 +01:00
..
.gitignore Move QFuture from QtConcurrent to QtCore 2012-09-28 23:50:10 +02:00
CMakeLists.txt Fix QFuture continuations/handlers to work with move-only callables 2021-12-01 01:58:18 +01:00
tst_qfuture.cpp Fix QFuture continuations/handlers to work with move-only callables 2021-12-01 01:58:18 +01:00