From c5e687895dd2eba3106f697b6e92b84683402403 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Mon, 16 Jan 2017 12:22:43 +0100 Subject: Adapt to the C++ SIC introduced by P0012: noexcept overloading see 5a1b4832a2 for more detail Task-number: QTBUG-58142 Change-Id: I51851ea9b4fe7b8eeadc452bc3dbb1ea00026d29 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/concurrent/qtconcurrentfunctionwrappers.h | 84 +++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) (limited to 'src/concurrent') diff --git a/src/concurrent/qtconcurrentfunctionwrappers.h b/src/concurrent/qtconcurrentfunctionwrappers.h index a08be69123..111933410b 100644 --- a/src/concurrent/qtconcurrentfunctionwrappers.h +++ b/src/concurrent/qtconcurrentfunctionwrappers.h @@ -192,6 +192,32 @@ QtConcurrent::ConstMemberFunctionWrapper createFunctionWrapper(T (C::*func return QtConcurrent::ConstMemberFunctionWrapper(func); } +#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 +template +QtConcurrent::FunctionWrapper1 createFunctionWrapper(T (*func)(U) noexcept) +{ + return QtConcurrent::FunctionWrapper1(func); +} + +template +QtConcurrent::MemberFunctionWrapper createFunctionWrapper(T (C::*func)() noexcept) +{ + return QtConcurrent::MemberFunctionWrapper(func); +} + +template +QtConcurrent::MemberFunctionWrapper1 createFunctionWrapper(T (C::*func)(U) noexcept) +{ + return QtConcurrent::MemberFunctionWrapper1(func); +} + +template +QtConcurrent::ConstMemberFunctionWrapper createFunctionWrapper(T (C::*func)() const noexcept) +{ + return QtConcurrent::ConstMemberFunctionWrapper(func); +} +#endif + struct PushBackWrapper { typedef void result_type; @@ -231,6 +257,20 @@ struct ReduceResultType typedef C ResultType; }; +#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 +template +struct ReduceResultType +{ + typedef U ResultType; +}; + +template +struct ReduceResultType +{ + typedef C ResultType; +}; +#endif + template struct MapResultType { @@ -249,6 +289,20 @@ struct MapResultType typedef T ResultType; }; +#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 +template +struct MapResultType +{ + typedef U ResultType; +}; + +template +struct MapResultType +{ + typedef T ResultType; +}; +#endif + #ifndef QT_NO_TEMPLATE_TEMPLATE_PARAMETERS template