From bb115cc21dddfb9b6cffe1bc9cb8eb18c423396c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 1 Mar 2023 15:34:44 +0100 Subject: [PATCH] Apply q20::remove_cvref_t around the code Found in API review. It's not BC-critical, but let's get this into 6.5 to minimize the diff to our future LTS. Change-Id: Iaa63afad1d31f6edef29e1185897d925f47a094d Reviewed-by: Fabian Kosmale (cherry picked from commit ebb833d7f70465844e474583571770ad14adcebf) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/kernel/qmetatype.h | 5 ++--- src/corelib/text/qbytearrayview.h | 7 +++---- src/corelib/text/qstringview.h | 5 +++-- src/corelib/text/qutf8stringview.h | 5 +++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 97e0eae7f97..e70f901a09b 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #ifdef Bool #error qmetatype.h must be included before any header file that defines Bool @@ -606,8 +606,7 @@ public: const From *f = static_cast(from); To *t = static_cast(to); auto &&r = function(*f); - if constexpr (std::is_same_v>, - std::optional>) { + if constexpr (std::is_same_v, std::optional>) { if (!r) return false; *t = *std::forward(r); diff --git a/src/corelib/text/qbytearrayview.h b/src/corelib/text/qbytearrayview.h index ad3bfbdaeb5..f822a2ca202 100644 --- a/src/corelib/text/qbytearrayview.h +++ b/src/corelib/text/qbytearrayview.h @@ -8,6 +8,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -23,8 +24,7 @@ struct IsCompatibleByteTypeHelper template struct IsCompatibleByteType - : IsCompatibleByteTypeHelper< - typename std::remove_cv_t>> {}; + : IsCompatibleByteTypeHelper> {}; template struct IsCompatibleByteArrayPointerHelper : std::false_type {}; @@ -33,8 +33,7 @@ struct IsCompatibleByteArrayPointerHelper : IsCompatibleByteType {}; template struct IsCompatibleByteArrayPointer - : IsCompatibleByteArrayPointerHelper< - typename std::remove_cv_t>> {}; + : IsCompatibleByteArrayPointerHelper> {}; template struct IsContainerCompatibleWithQByteArrayView : std::false_type {}; diff --git a/src/corelib/text/qstringview.h b/src/corelib/text/qstringview.h index fa2ad80a46e..20b61f18655 100644 --- a/src/corelib/text/qstringview.h +++ b/src/corelib/text/qstringview.h @@ -11,6 +11,7 @@ #include #include +#include #if defined(Q_OS_DARWIN) || defined(Q_QDOC) Q_FORWARD_DECLARE_CF_TYPE(CFString); @@ -34,7 +35,7 @@ struct IsCompatibleCharTypeHelper (std::is_same::value && sizeof(wchar_t) == sizeof(QChar))> {}; template struct IsCompatibleCharType - : IsCompatibleCharTypeHelper::type>::type> {}; + : IsCompatibleCharTypeHelper> {}; template struct IsCompatiblePointerHelper : std::false_type {}; @@ -43,7 +44,7 @@ struct IsCompatiblePointerHelper : IsCompatibleCharType {}; template struct IsCompatiblePointer - : IsCompatiblePointerHelper::type>::type> {}; + : IsCompatiblePointerHelper> {}; template struct IsContainerCompatibleWithQStringView : std::false_type {}; diff --git a/src/corelib/text/qutf8stringview.h b/src/corelib/text/qutf8stringview.h index 14a8a16e62b..c60d0e0c9a6 100644 --- a/src/corelib/text/qutf8stringview.h +++ b/src/corelib/text/qutf8stringview.h @@ -13,6 +13,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -28,7 +29,7 @@ using IsCompatibleChar8TypeHelper = std::disjunction< >; template using IsCompatibleChar8Type - = IsCompatibleChar8TypeHelper>>; + = IsCompatibleChar8TypeHelper>; template struct IsCompatiblePointer8Helper : std::false_type {}; @@ -37,7 +38,7 @@ struct IsCompatiblePointer8Helper : IsCompatibleChar8Type {}; template using IsCompatiblePointer8 - = IsCompatiblePointer8Helper>>; + = IsCompatiblePointer8Helper>; template struct IsContainerCompatibleWithQUtf8StringView : std::false_type {};