diff options
Diffstat (limited to 'src/corelib')
| -rw-r--r-- | src/corelib/concurrent/qtconcurrentfunctionwrappers.h | 12 | ||||
| -rw-r--r-- | src/corelib/concurrent/qtconcurrentmap.h | 8 |
2 files changed, 4 insertions, 16 deletions
diff --git a/src/corelib/concurrent/qtconcurrentfunctionwrappers.h b/src/corelib/concurrent/qtconcurrentfunctionwrappers.h index 1c19164b309..56526091fee 100644 --- a/src/corelib/concurrent/qtconcurrentfunctionwrappers.h +++ b/src/corelib/concurrent/qtconcurrentfunctionwrappers.h @@ -286,18 +286,6 @@ struct MapResultType<QStringList, U(C::*)() const> typedef QList<U> ResultType; }; -template <typename ReturnType, typename T> -struct DisableIfSame -{ - typedef ReturnType Type; -}; - -template <typename T> -struct DisableIfSame<T, T> -{ - -}; - } // namespace QtPrivate. #endif //qdoc diff --git a/src/corelib/concurrent/qtconcurrentmap.h b/src/corelib/concurrent/qtconcurrentmap.h index 601ab22610a..a857ab5917e 100644 --- a/src/corelib/concurrent/qtconcurrentmap.h +++ b/src/corelib/concurrent/qtconcurrentmap.h @@ -206,7 +206,7 @@ void blockingMap(Iterator begin, Iterator end, MapFunctor map) // blockingMappedReduced() for sequences template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor> -typename QtPrivate::DisableIfSame<ResultType, Sequence>::Type blockingMappedReduced(const Sequence &sequence, +ResultType blockingMappedReduced(const Sequence &sequence, MapFunctor map, ReduceFunctor reduce, ReduceOptions options = ReduceOptions(UnorderedReduce | SequentialReduce)) @@ -219,7 +219,7 @@ typename QtPrivate::DisableIfSame<ResultType, Sequence>::Type blockingMappedRedu .startBlocking(); } -template <typename Sequence, typename MapFunctor, typename ReduceFunctor> +template <typename MapFunctor, typename ReduceFunctor, typename Sequence> typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType blockingMappedReduced(const Sequence &sequence, MapFunctor map, ReduceFunctor reduce, @@ -266,7 +266,7 @@ typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType blockingMappedRe // mapped() for sequences with a different putput sequence type. template <typename OutputSequence, typename InputSequence, typename MapFunctor> -typename QtPrivate::DisableIfSame<OutputSequence, InputSequence>::Type blockingMapped(const InputSequence &sequence, MapFunctor map) +OutputSequence blockingMapped(const InputSequence &sequence, MapFunctor map) { return blockingMappedReduced<OutputSequence> (sequence, @@ -275,7 +275,7 @@ typename QtPrivate::DisableIfSame<OutputSequence, InputSequence>::Type blockingM QtConcurrent::OrderedReduce); } -template <typename InputSequence, typename MapFunctor> +template <typename MapFunctor, typename InputSequence> typename QtPrivate::MapResultType<InputSequence, MapFunctor>::ResultType blockingMapped(const InputSequence &sequence, MapFunctor map) { typedef typename QtPrivate::MapResultType<InputSequence, MapFunctor>::ResultType OutputSequence; |
