From d8f7b887540d376b134a6f730ab4e68c0505f13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 11 Jul 2023 09:57:23 +0200 Subject: [PATCH] Use the Callable helper in QCallableObject They do the same work in determining the way to call the callable but with slightly different preconditions. Let's just re-use it. Change-Id: Ie2ad54a49250ae8460d8f364f7ea01b651648034 Reviewed-by: Thiago Macieira Reviewed-by: Qt CI Bot --- src/corelib/kernel/qobjectdefs_impl.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h index 72928f22359..e8dd262672e 100644 --- a/src/corelib/kernel/qobjectdefs_impl.h +++ b/src/corelib/kernel/qobjectdefs_impl.h @@ -388,7 +388,11 @@ namespace QtPrivate { }; template - using Callable = typename CallableHelper::Type; + struct Callable : CallableHelper::Type + {}; + template + struct Callable> : CallableHelper::Type + {}; /* Wrapper around ComputeFunctorArgumentCount and CheckCompatibleArgument, @@ -531,10 +535,7 @@ namespace QtPrivate { { using FunctorValue = std::decay_t; using Storage = QtPrivate::CompactStorage; - using FuncType = std::conditional_t, - QtPrivate::FunctionPointer, - QtPrivate::Functor - >; + using FuncType = Callable; #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) Q_DECL_HIDDEN static void impl(int which, QSlotObjectBase *this_, QObject *r, void **a, bool *ret)