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.

Pick-to: 6.5
Change-Id: Iaa63afad1d31f6edef29e1185897d925f47a094d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Marc Mutz 2023-03-01 15:34:44 +01:00
parent 81a748efb7
commit ebb833d7f7
4 changed files with 11 additions and 11 deletions

View File

@ -26,7 +26,7 @@
#include <map>
#include <functional>
#include <optional>
#include <type_traits>
#include <QtCore/q20type_traits.h>
#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<const From *>(from);
To *t = static_cast<To *>(to);
auto &&r = function(*f);
if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<decltype(r)>>,
std::optional<To>>) {
if constexpr (std::is_same_v<q20::remove_cvref_t<decltype(r)>, std::optional<To>>) {
if (!r)
return false;
*t = *std::forward<decltype(r)>(r);

View File

@ -8,6 +8,7 @@
#include <QtCore/qarraydata.h>
#include <string>
#include <QtCore/q20type_traits.h>
QT_BEGIN_NAMESPACE
@ -23,8 +24,7 @@ struct IsCompatibleByteTypeHelper
template <typename Byte>
struct IsCompatibleByteType
: IsCompatibleByteTypeHelper<
typename std::remove_cv_t<typename std::remove_reference_t<Byte>>> {};
: IsCompatibleByteTypeHelper<q20::remove_cvref_t<Byte>> {};
template <typename Pointer>
struct IsCompatibleByteArrayPointerHelper : std::false_type {};
@ -33,8 +33,7 @@ struct IsCompatibleByteArrayPointerHelper<Byte *>
: IsCompatibleByteType<Byte> {};
template<typename Pointer>
struct IsCompatibleByteArrayPointer
: IsCompatibleByteArrayPointerHelper<
typename std::remove_cv_t<typename std::remove_reference_t<Pointer>>> {};
: IsCompatibleByteArrayPointerHelper<q20::remove_cvref_t<Pointer>> {};
template <typename T, typename Enable = void>
struct IsContainerCompatibleWithQByteArrayView : std::false_type {};

View File

@ -11,6 +11,7 @@
#include <QtCore/qutf8stringview.h>
#include <string>
#include <QtCore/q20type_traits.h>
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
Q_FORWARD_DECLARE_CF_TYPE(CFString);
@ -34,7 +35,7 @@ struct IsCompatibleCharTypeHelper
(std::is_same<Char, wchar_t>::value && sizeof(wchar_t) == sizeof(QChar))> {};
template <typename Char>
struct IsCompatibleCharType
: IsCompatibleCharTypeHelper<typename std::remove_cv<typename std::remove_reference<Char>::type>::type> {};
: IsCompatibleCharTypeHelper<q20::remove_cvref_t<Char>> {};
template <typename Pointer>
struct IsCompatiblePointerHelper : std::false_type {};
@ -43,7 +44,7 @@ struct IsCompatiblePointerHelper<Char*>
: IsCompatibleCharType<Char> {};
template <typename Pointer>
struct IsCompatiblePointer
: IsCompatiblePointerHelper<typename std::remove_cv<typename std::remove_reference<Pointer>::type>::type> {};
: IsCompatiblePointerHelper<q20::remove_cvref_t<Pointer>> {};
template <typename T, typename Enable = void>
struct IsContainerCompatibleWithQStringView : std::false_type {};

View File

@ -13,6 +13,7 @@
#include <QtCore/qbytearrayview.h>
#include <string>
#include <QtCore/q20type_traits.h>
QT_BEGIN_NAMESPACE
@ -28,7 +29,7 @@ using IsCompatibleChar8TypeHelper = std::disjunction<
>;
template <typename Char>
using IsCompatibleChar8Type
= IsCompatibleChar8TypeHelper<std::remove_cv_t<std::remove_reference_t<Char>>>;
= IsCompatibleChar8TypeHelper<q20::remove_cvref_t<Char>>;
template <typename Pointer>
struct IsCompatiblePointer8Helper : std::false_type {};
@ -37,7 +38,7 @@ struct IsCompatiblePointer8Helper<Char*>
: IsCompatibleChar8Type<Char> {};
template <typename Pointer>
using IsCompatiblePointer8
= IsCompatiblePointer8Helper<std::remove_cv_t<std::remove_reference_t<Pointer>>>;
= IsCompatiblePointer8Helper<q20::remove_cvref_t<Pointer>>;
template <typename T, typename Enable = void>
struct IsContainerCompatibleWithQUtf8StringView : std::false_type {};