From 8365322d3de709e86fc6c3962472dcc8944fb0a3 Mon Sep 17 00:00:00 2001 From: Vitaly Fanaskov Date: Tue, 31 Mar 2020 16:24:29 +0200 Subject: [PATCH] StoredFunctionCall: simplify runFunctor implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-82383 Change-Id: Ib8e196106c80e8f3aba1ff7d0c8b76a547c648da Reviewed-by: MÃ¥rten Nordheim --- src/concurrent/qtconcurrentstoredfunctioncall.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/concurrent/qtconcurrentstoredfunctioncall.h b/src/concurrent/qtconcurrentstoredfunctioncall.h index f64648d7e96..b879e8af451 100644 --- a/src/concurrent/qtconcurrentstoredfunctioncall.h +++ b/src/concurrent/qtconcurrentstoredfunctioncall.h @@ -80,20 +80,13 @@ struct StoredFunctionCall : public RunFunctionTask>::value>; + constexpr auto invoke = &std::invoke, + std::decay_t...>; - invoke(Indexes()); - } - - template - void invoke(std::index_sequence) - { if constexpr (std::is_void_v>) - std::invoke(std::get(std::move(data))...); + std::apply(invoke, std::move(data)); else - this->result = std::invoke(std::get(std::move(data))...); + this->result = std::apply(invoke, std::move(data)); } DecayedTuple data;