From 8e83d6150121412b9f493ff525bce6f09d105463 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Tue, 28 Mar 2017 08:48:46 +0200 Subject: Adapt to the C++ SIC introduced by P0012: noexcept specialization complements commit c5e687895dd2eba3106f697b6e92b84683402403 added missing noexcept (void)StoredMemberFunctionCall specialization to disambiguate template selection. Without these specializations, StoredFunctorPointerCall was a better match, which led to compilation failure Task-number: QTBUG-58142 Change-Id: Ibd41057d9a497f057a895d73277902e90300ed7a Reviewed-by: Allan Sandfeld Jensen --- src/concurrent/qtconcurrentstoredfunctioncall.h | 975 +++++++++++++++++++++++- 1 file changed, 964 insertions(+), 11 deletions(-) (limited to 'src/concurrent/qtconcurrentstoredfunctioncall.h') diff --git a/src/concurrent/qtconcurrentstoredfunctioncall.h b/src/concurrent/qtconcurrentstoredfunctioncall.h index eba6a1aad0..32a0214a88 100644 --- a/src/concurrent/qtconcurrentstoredfunctioncall.h +++ b/src/concurrent/qtconcurrentstoredfunctioncall.h @@ -255,6 +255,165 @@ struct SelectStoredConstMemberFunctionPointerCall0 Type, VoidStoredConstMemberFunctionPointerCall0 >::type type; }; +#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 +template +class StoredNoExceptMemberFunctionCall0 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionCall0(T (Class::*_fn)() noexcept, const Class &_object) + : fn(_fn), object(_object){ } + + void runFunctor() override + { + this->result = (object.*fn)(); + } +private: + T (Class::*fn)() noexcept; + Class object; + +}; +template +class VoidStoredNoExceptMemberFunctionCall0 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionCall0(T (Class::*_fn)() noexcept, const Class &_object) + : fn(_fn), object(_object){ } + + void runFunctor() override + { + (object.*fn)(); + } +private: + T (Class::*fn)() noexcept; + Class object; + +}; +template +struct SelectStoredNoExceptMemberFunctionCall0 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionCall0 >::type type; +}; +template +class StoredConstNoExceptMemberFunctionCall0 : public RunFunctionTask +{ +public: + StoredConstNoExceptMemberFunctionCall0(T (Class::*_fn)() const noexcept, const Class &_object) + : fn(_fn), object(_object){ } + + void runFunctor() override + { + this->result = (object.*fn)(); + } +private: + T (Class::*fn)() const noexcept; + const Class object; + +}; +template +class VoidStoredConstNoExceptMemberFunctionCall0 : public RunFunctionTask +{ +public: + VoidStoredConstNoExceptMemberFunctionCall0(T (Class::*_fn)() const noexcept, const Class &_object) + : fn(_fn), object(_object){ } + + void runFunctor() override + { + (object.*fn)(); + } +private: + T (Class::*fn)() const noexcept; + const Class object; + +}; +template +struct SelectStoredConstNoExceptMemberFunctionCall0 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstNoExceptMemberFunctionCall0 >::type type; +}; +template +class StoredNoExceptMemberFunctionPointerCall0 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionPointerCall0(T (Class::*_fn)() noexcept, Class *_object) + : fn(_fn), object(_object){ } + + void runFunctor() override + { + this->result = (object->*fn)(); + } +private: + T (Class::*fn)() noexcept; + Class *object; + +}; +template +class VoidStoredNoExceptMemberFunctionPointerCall0 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionPointerCall0(T (Class::*_fn)() noexcept, Class *_object) + : fn(_fn), object(_object){ } + + void runFunctor() override + { + (object->*fn)(); + } +private: + T (Class::*fn)() noexcept; + Class *object; + +}; +template +struct SelectStoredNoExceptMemberFunctionPointerCall0 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionPointerCall0 >::type type; +}; +template +class StoredConstNoExceptMemberFunctionPointerCall0 : public RunFunctionTask +{ +public: + StoredConstNoExceptMemberFunctionPointerCall0(T (Class::*_fn)() const noexcept, Class const *_object) + : fn(_fn), object(_object){ } + + void runFunctor() override + { + this->result = (object->*fn)(); + } +private: + T (Class::*fn)() const noexcept; + Class const *object; + +}; +template +class VoidStoredConstNoExceptMemberFunctionPointerCall0 : public RunFunctionTask +{ +public: + VoidStoredConstNoExceptMemberFunctionPointerCall0(T (Class::*_fn)() const noexcept, Class const *_object) + : fn(_fn), object(_object){ } + + void runFunctor() override + { + (object->*fn)(); + } +private: + T (Class::*fn)() const noexcept; + Class const *object; + +}; +template +struct SelectStoredConstNoExceptMemberFunctionPointerCall0 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstNoExceptMemberFunctionPointerCall0 >::type type; +}; +#endif + template struct StoredFunctorCall1: public RunFunctionTask { @@ -458,6 +617,165 @@ struct SelectStoredConstMemberFunctionPointerCall1 Type, VoidStoredConstMemberFunctionPointerCall1 >::type type; }; +#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 +template +class StoredNoExceptMemberFunctionCall1 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionCall1(T (Class::*_fn)(Param1) noexcept, const Class &_object, const Arg1 &_arg1) + : fn(_fn), object(_object), arg1(_arg1){ } + + void runFunctor() override + { + this->result = (object.*fn)(arg1); + } +private: + T (Class::*fn)(Param1) noexcept; + Class object; + Arg1 arg1; +}; +template +class VoidStoredNoExceptMemberFunctionCall1 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionCall1(T (Class::*_fn)(Param1) noexcept, const Class &_object, const Arg1 &_arg1) + : fn(_fn), object(_object), arg1(_arg1){ } + + void runFunctor() override + { + (object.*fn)(arg1); + } +private: + T (Class::*fn)(Param1) noexcept; + Class object; + Arg1 arg1; +}; +template +struct SelectStoredNoExceptMemberFunctionCall1 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionCall1 >::type type; +}; +template +class StoredConstNoExceptMemberFunctionCall1 : public RunFunctionTask +{ +public: + StoredConstNoExceptMemberFunctionCall1(T (Class::*_fn)(Param1) const noexcept, const Class &_object, const Arg1 &_arg1) + : fn(_fn), object(_object), arg1(_arg1){ } + + void runFunctor() override + { + this->result = (object.*fn)(arg1); + } +private: + T (Class::*fn)(Param1) const noexcept; + const Class object; + Arg1 arg1; +}; +template +class VoidStoredConstNoExceptMemberFunctionCall1 : public RunFunctionTask +{ +public: + VoidStoredConstNoExceptMemberFunctionCall1(T (Class::*_fn)(Param1) const noexcept, const Class &_object, const Arg1 &_arg1) + : fn(_fn), object(_object), arg1(_arg1){ } + + void runFunctor() override + { + (object.*fn)(arg1); + } +private: + T (Class::*fn)(Param1) const noexcept; + const Class object; + Arg1 arg1; +}; +template +struct SelectStoredConstNoExceptMemberFunctionCall1 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstNoExceptMemberFunctionCall1 >::type type; +}; +template +class StoredNoExceptMemberFunctionPointerCall1 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionPointerCall1(T (Class::*_fn)(Param1) noexcept, Class *_object, const Arg1 &_arg1) + : fn(_fn), object(_object), arg1(_arg1){ } + + void runFunctor() override + { + this->result = (object->*fn)(arg1); + } +private: + T (Class::*fn)(Param1) noexcept; + Class *object; + Arg1 arg1; +}; +template +class VoidStoredNoExceptMemberFunctionPointerCall1 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionPointerCall1(T (Class::*_fn)(Param1) noexcept, Class *_object, const Arg1 &_arg1) + : fn(_fn), object(_object), arg1(_arg1){ } + + void runFunctor() override + { + (object->*fn)(arg1); + } +private: + T (Class::*fn)(Param1) noexcept; + Class *object; + Arg1 arg1; +}; +template +struct SelectStoredNoExceptMemberFunctionPointerCall1 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionPointerCall1 >::type type; +}; +template +class StoredConstNoExceptMemberFunctionPointerCall1 : public RunFunctionTask +{ +public: + StoredConstNoExceptMemberFunctionPointerCall1(T (Class::*_fn)(Param1) const noexcept, Class const *_object, const Arg1 &_arg1) + : fn(_fn), object(_object), arg1(_arg1){ } + + void runFunctor() override + { + this->result = (object->*fn)(arg1); + } +private: + T (Class::*fn)(Param1) const noexcept; + Class const *object; + Arg1 arg1; +}; +template +class VoidStoredConstNoExceptMemberFunctionPointerCall1 : public RunFunctionTask +{ +public: + VoidStoredConstNoExceptMemberFunctionPointerCall1(T (Class::*_fn)(Param1) const noexcept, Class const *_object, const Arg1 &_arg1) + : fn(_fn), object(_object), arg1(_arg1){ } + + void runFunctor() override + { + (object->*fn)(arg1); + } +private: + T (Class::*fn)(Param1) const noexcept; + Class const *object; + Arg1 arg1; +}; +template +struct SelectStoredConstNoExceptMemberFunctionPointerCall1 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstNoExceptMemberFunctionPointerCall1 >::type type; +}; +#endif + template struct StoredFunctorCall2: public RunFunctionTask { @@ -661,6 +979,165 @@ struct SelectStoredConstMemberFunctionPointerCall2 Type, VoidStoredConstMemberFunctionPointerCall2 >::type type; }; +#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 +template +class StoredNoExceptMemberFunctionCall2 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } + + void runFunctor() override + { + this->result = (object.*fn)(arg1, arg2); + } +private: + T (Class::*fn)(Param1, Param2) noexcept; + Class object; + Arg1 arg1; Arg2 arg2; +}; +template +class VoidStoredNoExceptMemberFunctionCall2 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } + + void runFunctor() override + { + (object.*fn)(arg1, arg2); + } +private: + T (Class::*fn)(Param1, Param2) noexcept; + Class object; + Arg1 arg1; Arg2 arg2; +}; +template +struct SelectStoredNoExceptMemberFunctionCall2 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionCall2 >::type type; +}; +template +class StoredConstNoExceptMemberFunctionCall2 : public RunFunctionTask +{ +public: + StoredConstNoExceptMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } + + void runFunctor() override + { + this->result = (object.*fn)(arg1, arg2); + } +private: + T (Class::*fn)(Param1, Param2) const noexcept; + const Class object; + Arg1 arg1; Arg2 arg2; +}; +template +class VoidStoredConstNoExceptMemberFunctionCall2 : public RunFunctionTask +{ +public: + VoidStoredConstNoExceptMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } + + void runFunctor() override + { + (object.*fn)(arg1, arg2); + } +private: + T (Class::*fn)(Param1, Param2) const noexcept; + const Class object; + Arg1 arg1; Arg2 arg2; +}; +template +struct SelectStoredConstNoExceptMemberFunctionCall2 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstNoExceptMemberFunctionCall2 >::type type; +}; +template +class StoredNoExceptMemberFunctionPointerCall2 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } + + void runFunctor() override + { + this->result = (object->*fn)(arg1, arg2); + } +private: + T (Class::*fn)(Param1, Param2) noexcept; + Class *object; + Arg1 arg1; Arg2 arg2; +}; +template +class VoidStoredNoExceptMemberFunctionPointerCall2 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } + + void runFunctor() override + { + (object->*fn)(arg1, arg2); + } +private: + T (Class::*fn)(Param1, Param2) noexcept; + Class *object; + Arg1 arg1; Arg2 arg2; +}; +template +struct SelectStoredNoExceptMemberFunctionPointerCall2 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionPointerCall2 >::type type; +}; +template +class StoredConstNoExceptMemberFunctionPointerCall2 : public RunFunctionTask +{ +public: + StoredConstNoExceptMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } + + void runFunctor() override + { + this->result = (object->*fn)(arg1, arg2); + } +private: + T (Class::*fn)(Param1, Param2) const noexcept; + Class const *object; + Arg1 arg1; Arg2 arg2; +}; +template +class VoidStoredConstNoExceptMemberFunctionPointerCall2 : public RunFunctionTask +{ +public: + VoidStoredConstNoExceptMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } + + void runFunctor() override + { + (object->*fn)(arg1, arg2); + } +private: + T (Class::*fn)(Param1, Param2) const noexcept; + Class const *object; + Arg1 arg1; Arg2 arg2; +}; +template +struct SelectStoredConstNoExceptMemberFunctionPointerCall2 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstNoExceptMemberFunctionPointerCall2 >::type type; +}; +#endif + template struct StoredFunctorCall3: public RunFunctionTask { @@ -822,14 +1299,171 @@ template ::template - Type, - VoidStoredMemberFunctionPointerCall3 >::type type; + Type, + VoidStoredMemberFunctionPointerCall3 >::type type; +}; +template +class StoredConstMemberFunctionPointerCall3 : public RunFunctionTask +{ +public: + StoredConstMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } + + void runFunctor() override + { + this->result = (object->*fn)(arg1, arg2, arg3); + } +private: + T (Class::*fn)(Param1, Param2, Param3) const; + Class const *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +class VoidStoredConstMemberFunctionPointerCall3 : public RunFunctionTask +{ +public: + VoidStoredConstMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } + + void runFunctor() override + { + (object->*fn)(arg1, arg2, arg3); + } +private: + T (Class::*fn)(Param1, Param2, Param3) const; + Class const *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +struct SelectStoredConstMemberFunctionPointerCall3 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstMemberFunctionPointerCall3 >::type type; +}; +#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 +template +class StoredNoExceptMemberFunctionCall3 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } + + void runFunctor() override + { + this->result = (object.*fn)(arg1, arg2, arg3); + } +private: + T (Class::*fn)(Param1, Param2, Param3) noexcept; + Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +class VoidStoredNoExceptMemberFunctionCall3 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } + + void runFunctor() override + { + (object.*fn)(arg1, arg2, arg3); + } +private: + T (Class::*fn)(Param1, Param2, Param3) noexcept; + Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +struct SelectStoredNoExceptMemberFunctionCall3 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionCall3 >::type type; +}; +template +class StoredConstNoExceptMemberFunctionCall3 : public RunFunctionTask +{ +public: + StoredConstNoExceptMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } + + void runFunctor() override + { + this->result = (object.*fn)(arg1, arg2, arg3); + } +private: + T (Class::*fn)(Param1, Param2, Param3) const noexcept; + const Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +class VoidStoredConstNoExceptMemberFunctionCall3 : public RunFunctionTask +{ +public: + VoidStoredConstNoExceptMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } + + void runFunctor() override + { + (object.*fn)(arg1, arg2, arg3); + } +private: + T (Class::*fn)(Param1, Param2, Param3) const noexcept; + const Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +struct SelectStoredConstNoExceptMemberFunctionCall3 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstNoExceptMemberFunctionCall3 >::type type; +}; +template +class StoredNoExceptMemberFunctionPointerCall3 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } + + void runFunctor() override + { + this->result = (object->*fn)(arg1, arg2, arg3); + } +private: + T (Class::*fn)(Param1, Param2, Param3) noexcept; + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +class VoidStoredNoExceptMemberFunctionPointerCall3 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } + + void runFunctor() override + { + (object->*fn)(arg1, arg2, arg3); + } +private: + T (Class::*fn)(Param1, Param2, Param3) noexcept; + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +struct SelectStoredNoExceptMemberFunctionPointerCall3 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionPointerCall3 >::type type; }; template -class StoredConstMemberFunctionPointerCall3 : public RunFunctionTask +class StoredConstNoExceptMemberFunctionPointerCall3 : public RunFunctionTask { public: - StoredConstMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) + StoredConstNoExceptMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } void runFunctor() override @@ -837,15 +1471,15 @@ public: this->result = (object->*fn)(arg1, arg2, arg3); } private: - T (Class::*fn)(Param1, Param2, Param3) const; + T (Class::*fn)(Param1, Param2, Param3) const noexcept; Class const *object; Arg1 arg1; Arg2 arg2; Arg3 arg3; }; template -class VoidStoredConstMemberFunctionPointerCall3 : public RunFunctionTask +class VoidStoredConstNoExceptMemberFunctionPointerCall3 : public RunFunctionTask { public: - VoidStoredConstMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) + VoidStoredConstNoExceptMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } void runFunctor() override @@ -853,17 +1487,19 @@ public: (object->*fn)(arg1, arg2, arg3); } private: - T (Class::*fn)(Param1, Param2, Param3) const; + T (Class::*fn)(Param1, Param2, Param3) const noexcept; Class const *object; Arg1 arg1; Arg2 arg2; Arg3 arg3; }; template -struct SelectStoredConstMemberFunctionPointerCall3 +struct SelectStoredConstNoExceptMemberFunctionPointerCall3 { typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionPointerCall3 >::type type; + Type, + VoidStoredConstNoExceptMemberFunctionPointerCall3 >::type type; }; +#endif + template struct StoredFunctorCall4: public RunFunctionTask { @@ -1067,6 +1703,165 @@ struct SelectStoredConstMemberFunctionPointerCall4 Type, VoidStoredConstMemberFunctionPointerCall4 >::type type; }; +#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 +template +class StoredNoExceptMemberFunctionCall4 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } + + void runFunctor() override + { + this->result = (object.*fn)(arg1, arg2, arg3, arg4); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4) noexcept; + Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +class VoidStoredNoExceptMemberFunctionCall4 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } + + void runFunctor() override + { + (object.*fn)(arg1, arg2, arg3, arg4); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4) noexcept; + Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +struct SelectStoredNoExceptMemberFunctionCall4 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionCall4 >::type type; +}; +template +class StoredConstNoExceptMemberFunctionCall4 : public RunFunctionTask +{ +public: + StoredConstNoExceptMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } + + void runFunctor() override + { + this->result = (object.*fn)(arg1, arg2, arg3, arg4); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4) const noexcept; + const Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +class VoidStoredConstNoExceptMemberFunctionCall4 : public RunFunctionTask +{ +public: + VoidStoredConstNoExceptMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } + + void runFunctor() override + { + (object.*fn)(arg1, arg2, arg3, arg4); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4) const noexcept; + const Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +struct SelectStoredConstNoExceptMemberFunctionCall4 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstNoExceptMemberFunctionCall4 >::type type; +}; +template +class StoredNoExceptMemberFunctionPointerCall4 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } + + void runFunctor() override + { + this->result = (object->*fn)(arg1, arg2, arg3, arg4); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4) noexcept; + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +class VoidStoredNoExceptMemberFunctionPointerCall4 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } + + void runFunctor() override + { + (object->*fn)(arg1, arg2, arg3, arg4); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4) noexcept; + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +struct SelectStoredNoExceptMemberFunctionPointerCall4 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionPointerCall4 >::type type; +}; +template +class StoredConstNoExceptMemberFunctionPointerCall4 : public RunFunctionTask +{ +public: + StoredConstNoExceptMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } + + void runFunctor() override + { + this->result = (object->*fn)(arg1, arg2, arg3, arg4); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4) const noexcept; + Class const *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +class VoidStoredConstNoExceptMemberFunctionPointerCall4 : public RunFunctionTask +{ +public: + VoidStoredConstNoExceptMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } + + void runFunctor() override + { + (object->*fn)(arg1, arg2, arg3, arg4); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4) const noexcept; + Class const *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +struct SelectStoredConstNoExceptMemberFunctionPointerCall4 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstNoExceptMemberFunctionPointerCall4 >::type type; +}; +#endif + template struct StoredFunctorCall5: public RunFunctionTask { @@ -1270,6 +2065,164 @@ struct SelectStoredConstMemberFunctionPointerCall5 Type, VoidStoredConstMemberFunctionPointerCall5 >::type type; }; +#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 +template +class StoredNoExceptMemberFunctionCall5 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + + void runFunctor() override + { + this->result = (object.*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) noexcept; + Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +class VoidStoredNoExceptMemberFunctionCall5 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + + void runFunctor() override + { + (object.*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) noexcept; + Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +struct SelectStoredNoExceptMemberFunctionCall5 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionCall5 >::type type; +}; +template +class StoredConstNoExceptMemberFunctionCall5 : public RunFunctionTask +{ +public: + StoredConstNoExceptMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + + void runFunctor() override + { + this->result = (object.*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const noexcept; + const Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +class VoidStoredConstNoExceptMemberFunctionCall5 : public RunFunctionTask +{ +public: + VoidStoredConstNoExceptMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + + void runFunctor() override + { + (object.*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const noexcept; + const Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +struct SelectStoredConstNoExceptMemberFunctionCall5 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstNoExceptMemberFunctionCall5 >::type type; +}; +template +class StoredNoExceptMemberFunctionPointerCall5 : public RunFunctionTask +{ +public: + StoredNoExceptMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + + void runFunctor() override + { + this->result = (object->*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) noexcept; + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +class VoidStoredNoExceptMemberFunctionPointerCall5 : public RunFunctionTask +{ +public: + VoidStoredNoExceptMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + + void runFunctor() override + { + (object->*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) noexcept; + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +struct SelectStoredNoExceptMemberFunctionPointerCall5 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredNoExceptMemberFunctionPointerCall5 >::type type; +}; +template +class StoredConstNoExceptMemberFunctionPointerCall5 : public RunFunctionTask +{ +public: + StoredConstNoExceptMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + + void runFunctor() override + { + this->result = (object->*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const noexcept; + Class const *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +class VoidStoredConstNoExceptMemberFunctionPointerCall5 : public RunFunctionTask +{ +public: + VoidStoredConstNoExceptMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) + : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + + void runFunctor() override + { + (object->*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const noexcept; + Class const *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +struct SelectStoredConstNoExceptMemberFunctionPointerCall5 +{ + typedef typename SelectSpecialization::template + Type, + VoidStoredConstNoExceptMemberFunctionPointerCall5 >::type type; +}; +#endif template class StoredFunctorCall : public RunFunctionTask -- cgit v1.2.3