From 91f5144f9042d100e1dd91b4fcf1b12969e3b8d3 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 20 Apr 2011 16:13:03 +0200 Subject: [PATCH] Compile with msvc msvc tries to instenties the return type of overloads that are not chosen by overload resolution (cherry picked from commit 7307d712e10783b57c4c95c8390a9455b69f473a) --- .../concurrent/qtconcurrentfunctionwrappers.h | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/corelib/concurrent/qtconcurrentfunctionwrappers.h b/src/corelib/concurrent/qtconcurrentfunctionwrappers.h index 4c4714fe45..fa675eb336 100644 --- a/src/corelib/concurrent/qtconcurrentfunctionwrappers.h +++ b/src/corelib/concurrent/qtconcurrentfunctionwrappers.h @@ -195,6 +195,18 @@ QtConcurrent::ConstMemberFunctionWrapper createFunctionWrapper(T (C::*func return QtConcurrent::ConstMemberFunctionWrapper(func); } + +template +void *lazyResultType_helper(int, typename T::result_type * = 0); +template +char lazyResultType_helper(double); + +template (0)) != sizeof(void*)> +struct LazyResultType { typedef typename Functor::result_type Type; }; +template +struct LazyResultType { typedef void Type; }; + + template struct ReduceResultType; @@ -213,7 +225,7 @@ struct ReduceResultType template struct MapResultType { - typedef typename MapFunctor::result_type ResultType; + typedef typename LazyResultType::Type ResultType; }; template @@ -233,7 +245,7 @@ struct MapResultType template