mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Worker task wrapper lambda needs to be mutable so its captured task can be moved from properly.
This commit is contained in:
committed by
Klaus Basan
parent
cf5a807bc6
commit
cf92fbeb03
@@ -224,7 +224,7 @@ namespace BlackMisc
|
||||
static CWorker *fromTask(QObject *owner, const QString &name, F &&task)
|
||||
{
|
||||
int typeId = qMetaTypeId<std::decay_t<decltype(std::forward<F>(task)())>>();
|
||||
return fromTaskImpl(owner, name, typeId, [task = std::forward<F>(task)]() { return CVariant::fromResultOf(std::move(task)); });
|
||||
return fromTaskImpl(owner, name, typeId, [task = std::forward<F>(task)]() mutable { return CVariant::fromResultOf(std::move(task)); });
|
||||
}
|
||||
|
||||
//! Connects to a functor to which will be passed the result when the task is finished.
|
||||
|
||||
Reference in New Issue
Block a user