From 28e194d3b25f5fc6e17cce8dddba7f7e16002c43 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Mon, 6 Sep 2021 14:37:32 +0200 Subject: Fix QtConcurrent::blockingMapped to work with non-template sequences MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code for deducing the type of output sequence was assuming that the input sequence is always a template class and was trying to use the corresponding container type for the output sequence. Fixed the deduction code, to assume that the output sequence has the same type as the input sequence, when it's not a template class. Also added tests to verify that all QtConcurrent functions support non-template input sequences. Fixes: QTBUG-30617 Pick-to: 6.2 6.1 Change-Id: I486fe99f3207cfff5dcceb3712cc7de863067edb Reviewed-by: MÃ¥rten Nordheim --- src/concurrent/qtconcurrentfunctionwrappers.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/concurrent/qtconcurrentfunctionwrappers.h') diff --git a/src/concurrent/qtconcurrentfunctionwrappers.h b/src/concurrent/qtconcurrentfunctionwrappers.h index be4a09f107d..1c882d3f194 100644 --- a/src/concurrent/qtconcurrentfunctionwrappers.h +++ b/src/concurrent/qtconcurrentfunctionwrappers.h @@ -190,7 +190,13 @@ struct ReduceResultTypeHelper -struct MapSequenceResultType; +struct MapSequenceResultType +{ + static_assert(std::is_same_v>, + "Couldn't deduce the output sequence type, you must specify it explicitly."); + typedef InputSequence ResultType; +}; #ifndef QT_NO_TEMPLATE_TEMPLATE_PARAMETERS -- cgit v1.2.3