From 5a0d4f3313157d2fe48e9d159968bed6883eb5f8 Mon Sep 17 00:00:00 2001 From: Vitaly Fanaskov Date: Wed, 11 Mar 2020 18:07:03 +0100 Subject: QtConcurrent: add fluent interface to configure a task before run Task-number: QTBUG-82950 Change-Id: I449da938b6b501a7646b3425edde5c880d6ca87e Reviewed-by: Qt CI Bot Reviewed-by: Paul Wicking Reviewed-by: Mikhail Svetkin --- src/concurrent/qtconcurrentstoredfunctioncall.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/concurrent/qtconcurrentstoredfunctioncall.h') diff --git a/src/concurrent/qtconcurrentstoredfunctioncall.h b/src/concurrent/qtconcurrentstoredfunctioncall.h index e2d0e3de0fd..f64648d7e96 100644 --- a/src/concurrent/qtconcurrentstoredfunctioncall.h +++ b/src/concurrent/qtconcurrentstoredfunctioncall.h @@ -48,7 +48,6 @@ QT_BEGIN_NAMESPACE - #ifndef Q_QDOC namespace QtConcurrent { @@ -65,16 +64,20 @@ struct InvokeResult template using InvokeResultType = typename InvokeResult::Type; +template +using DecayedTuple = std::tuple...>; + template struct StoredFunctionCall : public RunFunctionTask> { - template - using DecayedTuple = std::tuple...>; - StoredFunctionCall(Function &&f, Args &&...args) : data{std::forward(f), std::forward(args)...} {} + StoredFunctionCall(DecayedTuple &&_data) + : data(std::move(_data)) + {} + void runFunctor() override { using Indexes = -- cgit v1.2.3