qobjectdefs.h: optimize AreOldStyleArgs

Use a template alias instead of C++98-style inheritance.

Saves one template instantiation.

Pick-to: 6.5
Change-Id: I95ee9cf1e5eac1db5fc8e05cd95f5e745134214d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Marc Mutz 2023-03-01 14:00:23 +01:00
parent ebb833d7f7
commit b37b820ce8

View File

@ -145,9 +145,9 @@ struct QMetaMethodReturnArgument
namespace QtPrivate { namespace QtPrivate {
namespace Invoke { namespace Invoke {
#if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0) #if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0)
template <typename... Args> struct AreOldStyleArgs : template <typename... Args>
std::disjunction<std::is_base_of<QGenericArgument, Args>...> using AreOldStyleArgs = std::disjunction<std::is_base_of<QGenericArgument, Args>...>;
{};
template <typename T, typename... Args> using IfNotOldStyleArgs = template <typename T, typename... Args> using IfNotOldStyleArgs =
std::enable_if_t<!AreOldStyleArgs<Args...>::value, T>; std::enable_if_t<!AreOldStyleArgs<Args...>::value, T>;
#else #else