From e9d198b5928e1adf678796c098113bc307ef53f5 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 19 Apr 2011 15:58:09 +0200 Subject: get rid of the DisableIfSame hack By changing the order of the parametters, in a way it is unlikely to clash --- src/corelib/concurrent/qtconcurrentfunctionwrappers.h | 12 ------------ 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 1c19164..5652609 100644 --- a/src/corelib/concurrent/qtconcurrentfunctionwrappers.h +++ b/src/corelib/concurrent/qtconcurrentfunctionwrappers.h @@ -286,18 +286,6 @@ struct MapResultType typedef QList ResultType; }; -template -struct DisableIfSame -{ - typedef ReturnType Type; -}; - -template -struct DisableIfSame -{ - -}; - } // namespace QtPrivate. #endif //qdoc diff --git a/src/corelib/concurrent/qtconcurrentmap.h b/src/corelib/concurrent/qtconcurrentmap.h index 601ab22..a857ab5 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 QtPrivate::DisableIfSame::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::Type blockingMappedRedu .startBlocking(); } -template +template typename QtPrivate::ReduceResultType::ResultType blockingMappedReduced(const Sequence &sequence, MapFunctor map, ReduceFunctor reduce, @@ -266,7 +266,7 @@ typename QtPrivate::ReduceResultType::ResultType blockingMappedRe // mapped() for sequences with a different putput sequence type. template -typename QtPrivate::DisableIfSame::Type blockingMapped(const InputSequence &sequence, MapFunctor map) +OutputSequence blockingMapped(const InputSequence &sequence, MapFunctor map) { return blockingMappedReduced (sequence, @@ -275,7 +275,7 @@ typename QtPrivate::DisableIfSame::Type blockingM QtConcurrent::OrderedReduce); } -template +template typename QtPrivate::MapResultType::ResultType blockingMapped(const InputSequence &sequence, MapFunctor map) { typedef typename QtPrivate::MapResultType::ResultType OutputSequence; -- cgit v0.12