diff options
author | Liang Qi <liang.qi@qt.io> | 2017-01-24 10:33:37 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-01-25 20:06:06 +0100 |
commit | 318b58562ae89453fb98e8145cd0440e14ba60b0 (patch) | |
tree | 622bc032cf076b4569621032f3a3315d95c3ae88 /src/corelib/kernel/qobjectdefs_impl.h | |
parent | c28fde3fdac19fd5a5f614bb7983080031c924b3 (diff) | |
parent | 79352528a1726b4551ea4d9285dd2394dd0d43da (diff) |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
.qmake.conf
mkspecs/common/msvc-desktop.conf
mkspecs/common/msvc-version.conf
mkspecs/common/winrt_winphone/qmake.conf
mkspecs/features/mac/default_post.prf
mkspecs/features/mac/sdk.prf
mkspecs/features/qt.prf
mkspecs/features/uikit/default_post.prf
mkspecs/features/winrt/default_pre.prf
mkspecs/winphone-arm-msvc2013/qmake.conf
mkspecs/winphone-x86-msvc2013/qmake.conf
mkspecs/winrt-arm-msvc2013/qmake.conf
mkspecs/winrt-x64-msvc2013/qmake.conf
mkspecs/winrt-x86-msvc2013/qmake.conf
qmake/generators/win32/msvc_vcproj.cpp
src/gui/kernel/qwindowsysteminterface.cpp
src/network/kernel/qhostaddress.cpp
src/plugins/platforms/mirclient/qmirclientplugin.cpp
src/plugins/platforms/mirclient/qmirclientplugin.h
src/widgets/util/qsystemtrayicon.cpp
tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
tools/configure/Makefile.mingw
tools/configure/Makefile.win32
Done-with: Jake Petroules <jake.petroules@qt.io>
Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I4be3262d3994e11929d3b1ded2c3379783797dbe
Diffstat (limited to 'src/corelib/kernel/qobjectdefs_impl.h')
-rw-r--r-- | src/corelib/kernel/qobjectdefs_impl.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h index 79c9c8303e..1768e8ccc6 100644 --- a/src/corelib/kernel/qobjectdefs_impl.h +++ b/src/corelib/kernel/qobjectdefs_impl.h @@ -149,6 +149,20 @@ namespace QtPrivate { (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[II+1]))...), ApplyReturnValue<R>(arg[0]); } }; +#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 + template <int... II, typename... SignalArgs, typename R, typename... SlotArgs, typename SlotRet, class Obj> + struct FunctorCall<IndexesList<II...>, List<SignalArgs...>, R, SlotRet (Obj::*)(SlotArgs...) noexcept> { + static void call(SlotRet (Obj::*f)(SlotArgs...) noexcept, Obj *o, void **arg) { + (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[II+1]))...), ApplyReturnValue<R>(arg[0]); + } + }; + template <int... II, typename... SignalArgs, typename R, typename... SlotArgs, typename SlotRet, class Obj> + struct FunctorCall<IndexesList<II...>, List<SignalArgs...>, R, SlotRet (Obj::*)(SlotArgs...) const noexcept> { + static void call(SlotRet (Obj::*f)(SlotArgs...) const noexcept, Obj *o, void **arg) { + (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[II+1]))...), ApplyReturnValue<R>(arg[0]); + } + }; +#endif template<class Obj, typename Ret, typename... Args> struct FunctionPointer<Ret (Obj::*) (Args...)> { @@ -187,6 +201,47 @@ namespace QtPrivate { } }; +#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 + template<class Obj, typename Ret, typename... Args> struct FunctionPointer<Ret (Obj::*) (Args...) noexcept> + { + typedef Obj Object; + typedef List<Args...> Arguments; + typedef Ret ReturnType; + typedef Ret (Obj::*Function) (Args...) noexcept; + template <class Base> struct ChangeClass { typedef Ret (Base:: *Type)(Args...) noexcept; }; + enum {ArgumentCount = sizeof...(Args), IsPointerToMemberFunction = true}; + template <typename SignalArgs, typename R> + static void call(Function f, Obj *o, void **arg) { + FunctorCall<typename Indexes<ArgumentCount>::Value, SignalArgs, R, Function>::call(f, o, arg); + } + }; + template<class Obj, typename Ret, typename... Args> struct FunctionPointer<Ret (Obj::*) (Args...) const noexcept> + { + typedef Obj Object; + typedef List<Args...> Arguments; + typedef Ret ReturnType; + typedef Ret (Obj::*Function) (Args...) const noexcept; + template <class Base> struct ChangeClass { typedef Ret (Base:: *Type)(Args...) const noexcept; }; + enum {ArgumentCount = sizeof...(Args), IsPointerToMemberFunction = true}; + template <typename SignalArgs, typename R> + static void call(Function f, Obj *o, void **arg) { + FunctorCall<typename Indexes<ArgumentCount>::Value, SignalArgs, R, Function>::call(f, o, arg); + } + }; + + template<typename Ret, typename... Args> struct FunctionPointer<Ret (*) (Args...) noexcept> + { + typedef List<Args...> Arguments; + typedef Ret ReturnType; + typedef Ret (*Function) (Args...) noexcept; + enum {ArgumentCount = sizeof...(Args), IsPointerToMemberFunction = false}; + template <typename SignalArgs, typename R> + static void call(Function f, void *, void **arg) { + FunctorCall<typename Indexes<ArgumentCount>::Value, SignalArgs, R, Function>::call(f, arg); + } + }; +#endif + template<typename Function, int N> struct Functor { template <typename SignalArgs, typename R> |