summaryrefslogtreecommitdiffstats
path: root/src/concurrent
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2021-09-06 14:37:32 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2021-09-08 15:05:32 +0200
commit28e194d3b25f5fc6e17cce8dddba7f7e16002c43 (patch)
treed8291664b59379053806c5df00ed408c95e47421 /src/concurrent
parent2b0e55a3e2a4631bce12da633f8a9ce889a58878 (diff)
Fix QtConcurrent::blockingMapped to work with non-template sequences
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 <marten.nordheim@qt.io>
Diffstat (limited to 'src/concurrent')
-rw-r--r--src/concurrent/qtconcurrentfunctionwrappers.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/concurrent/qtconcurrentfunctionwrappers.h b/src/concurrent/qtconcurrentfunctionwrappers.h
index be4a09f107..1c882d3f19 100644
--- a/src/concurrent/qtconcurrentfunctionwrappers.h
+++ b/src/concurrent/qtconcurrentfunctionwrappers.h
@@ -190,7 +190,13 @@ struct ReduceResultTypeHelper<Callable,
// -- MapSequenceResultType
template <class InputSequence, class MapFunctor>
-struct MapSequenceResultType;
+struct MapSequenceResultType
+{
+ static_assert(std::is_same_v<typename InputSequence::value_type,
+ QtPrivate::MapResultType<InputSequence, MapFunctor>>,
+ "Couldn't deduce the output sequence type, you must specify it explicitly.");
+ typedef InputSequence ResultType;
+};
#ifndef QT_NO_TEMPLATE_TEMPLATE_PARAMETERS