Fix compilation of Qt Concurrent with gcc 4.3

GCC 4.3 had support for decltype but not the new function syntax (which
we call "auto function" for short). That meant the code did not compile.

qtconcurrentrun.h:105: error: expected initializer before ‘->’ token

Task-number: QTBUG-28984
Change-Id: I792276ec59c4f6e73f6137c517636e70c71ed849
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Thiago Macieira 2013-01-08 10:31:26 -02:00 committed by The Qt Project
parent c174d101bd
commit 0c4f6c6ea9

View File

@ -98,7 +98,7 @@ QFuture<T> run(T (*functionPointer)(Param1, Param2, Param3, Param4, Param5), con
return (new StoredFunctorCall5<T, T (*)(Param1, Param2, Param3, Param4, Param5), Arg1, Arg2, Arg3, Arg4, Arg5>(functionPointer, arg1, arg2, arg3, arg4, arg5))->start();
}
#ifdef Q_COMPILER_DECLTYPE
#if defined(Q_COMPILER_DECLTYPE) && defined(Q_COMPILER_AUTO_FUNCTION)
template <typename Functor>
auto run(Functor functor) -> typename QtPrivate::QEnableIf<!QtPrivate::HasResultType<Functor>::Value, QFuture<decltype(functor())> >::Type