From 7307d712e10783b57c4c95c8390a9455b69f473a Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 20 Apr 2011 16:13:03 +0200 Subject: Compile with msvc msvc tries to instenties the return type of overloads that are not chosen by overload resolution --- .../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 4c4714f..fa675eb 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