diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-04-18 14:07:32 +0200 |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-26 14:16:21 +0200 |
commit | d3e5fc0220e57d5a9bba35780915c53790ff249f (patch) | |
tree | 529b8e8cb514b0f0bd50e28c6561c3207bfc571d /src/corelib/concurrent/qtconcurrentfunctionwrappers.h | |
parent | 83291e6a07a9b6dc6c2d05b4fd4492df79796bbf (diff) |
Support of lambdas in QtConcurrent::run
Reviewed-by: Joao
(cherry picked from commit 917f2ff617209bcc283eb3590b422bcf239c0537)
Change-Id: I837f18f043b18410c1d93b9f1156acf729dad510
Reviewed-on: http://codereview.qt.nokia.com/142
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
Diffstat (limited to 'src/corelib/concurrent/qtconcurrentfunctionwrappers.h')
-rw-r--r-- | src/corelib/concurrent/qtconcurrentfunctionwrappers.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/corelib/concurrent/qtconcurrentfunctionwrappers.h b/src/corelib/concurrent/qtconcurrentfunctionwrappers.h index a79ad1c305..4bf2736e6c 100644 --- a/src/corelib/concurrent/qtconcurrentfunctionwrappers.h +++ b/src/corelib/concurrent/qtconcurrentfunctionwrappers.h @@ -195,17 +195,10 @@ QtConcurrent::ConstMemberFunctionWrapper<T, C> createFunctionWrapper(T (C::*func return QtConcurrent::ConstMemberFunctionWrapper<T, C>(func); } - -template<typename T> -void *lazyResultType_helper(int, typename T::result_type * = 0); -template<typename T> -char lazyResultType_helper(double); - -template <typename Functor, bool foo = sizeof(lazyResultType_helper<Functor>(0)) != sizeof(void*)> +template <typename Functor, bool foo = HasResultType<Functor>::Value> struct LazyResultType { typedef typename Functor::result_type Type; }; template <typename Functor> -struct LazyResultType<Functor, true> { typedef void Type; }; - +struct LazyResultType<Functor, false> { typedef void Type; }; template <class T> struct ReduceResultType; |