diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-04-19 15:58:09 +0200 |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-05-10 12:54:53 +0200 |
commit | 7efa2f6aab6801783e236d66331ae1d88ebf17ff (patch) | |
tree | 2a537ff686f5c821b16c7b6695a629acc2286eb8 /src | |
parent | 5d85018720f8a5ba60be45a541c2e8fd9b413578 (diff) |
get rid of the DisableIfSame hack
By changing the order of the parametters, in a way it is unlikely to clash
(cherry picked from commit e9d198b5928e1adf678796c098113bc307ef53f5)
Diffstat (limited to 'src')
-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 1c19164b30..56526091fe 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 601ab22610..a857ab5917 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; |