From 7211771c64caad7880212b1a35d4a6070800c0fa Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 16 Jul 2022 09:38:09 -0700 Subject: [PATCH] QMetaType: move is_complete template further up Alongside the rest, makes the code better organized. Pick-to: 6.4 Change-Id: I36b24183fbd041179f2ffffd17025ca7fe988a5a Reviewed-by: Volker Hilsheimer Reviewed-by: Fabian Kosmale --- src/corelib/kernel/qmetatype.h | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 7a66767258..18d59e1298 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -831,6 +831,20 @@ QT_FOR_EACH_AUTOMATIC_TEMPLATE_SMART_POINTER(QT_FORWARD_DECLARE_SHARED_POINTER_T namespace QtPrivate { + namespace detail { + template + struct is_complete_helper + { + template + static auto check(U *) -> std::integral_constant; + static auto check(...) -> std::false_type; + using type = decltype(check(static_cast(nullptr))); + }; + } // namespace detail + + template + struct is_complete : detail::is_complete_helper::type {}; + template struct IsPointerToTypeDerivedFromQObject { @@ -2464,7 +2478,6 @@ QT_FOR_EACH_STATIC_CORE_POINTER(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER) QT_FOR_EACH_STATIC_CORE_TEMPLATE(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER) #undef QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER #endif - template constexpr const QMetaTypeInterface *qMetaTypeInterfaceForType() { @@ -2472,20 +2485,6 @@ constexpr const QMetaTypeInterface *qMetaTypeInterfaceForType() return &QMetaTypeInterfaceWrapper::metaType; } -namespace detail { -template -struct is_complete_helper -{ - template - static auto check(U *) -> std::integral_constant; - static auto check(...) -> std::false_type; - using type = decltype(check(static_cast(nullptr))); -}; -} // namespace detail - -template -struct is_complete : detail::is_complete_helper::type {}; - template struct qRemovePointerLike {