summaryrefslogtreecommitdiffstats
path: root/src/concurrent/qtconcurrentfunctionwrappers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/concurrent/qtconcurrentfunctionwrappers.h')
-rw-r--r--src/concurrent/qtconcurrentfunctionwrappers.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/concurrent/qtconcurrentfunctionwrappers.h b/src/concurrent/qtconcurrentfunctionwrappers.h
index b337b90e0a..78900c239b 100644
--- a/src/concurrent/qtconcurrentfunctionwrappers.h
+++ b/src/concurrent/qtconcurrentfunctionwrappers.h
@@ -5,11 +5,12 @@
#define QTCONCURRENT_FUNCTIONWRAPPERS_H
#include <QtConcurrent/qtconcurrentcompilertest.h>
+#include <QtConcurrent/qtconcurrentreducekernel.h>
#include <QtCore/qfuture.h>
#include <tuple>
-#if !defined(QT_NO_CONCURRENT) || defined(Q_CLANG_QDOC)
+#if !defined(QT_NO_CONCURRENT) || defined(Q_QDOC)
QT_BEGIN_NAMESPACE
@@ -121,6 +122,11 @@ inline constexpr bool isIterator_v<T, std::void_t<typename std::iterator_traits<
template <class Callable, class Sequence>
using isInvocable = std::is_invocable<Callable, typename std::decay_t<Sequence>::value_type>;
+template <class InitialValueType, class ResultType>
+inline constexpr bool isInitialValueCompatible_v = std::conjunction_v<
+ std::is_convertible<InitialValueType, ResultType>,
+ std::negation<std::is_same<std::decay_t<InitialValueType>, QtConcurrent::ReduceOption>>>;
+
template<class Callable, class Enable = void>
struct ReduceResultTypeHelper
{
@@ -163,14 +169,6 @@ struct MapSequenceResultType<InputSequence<T...>, MapFunctor>
#endif // QT_NO_TEMPLATE_TEMPLATE_PARAMETER
-template<typename Sequence>
-struct SequenceHolder
-{
- SequenceHolder(const Sequence &s) : sequence(s) { }
- SequenceHolder(Sequence &&s) : sequence(std::move(s)) { }
- Sequence sequence;
-};
-
} // namespace QtPrivate.