summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-12-04 11:41:25 -0800
committerMarc Mutz <marc.mutz@qt.io>2022-12-07 06:24:14 +0000
commite02933a17c3615bc6e86f571fc6946390f43bd16 (patch)
tree99544c296aefc212e7bad15929b013587d48b3a1 /src
parent8be744df8a67401fcbe598eb1be76d8bf88fffd1 (diff)
QAnyStringView: move the two assertions to a central place
Move the assertions to qtypes.cpp, next to where one of them already existed. Change-Id: I51d12ccdc56c4ad2af07fffd172dae7c49d78273 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qtypes.cpp1
-rw-r--r--src/corelib/text/qanystringview.h2
2 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/global/qtypes.cpp b/src/corelib/global/qtypes.cpp
index 515f158f52..5c3b963a92 100644
--- a/src/corelib/global/qtypes.cpp
+++ b/src/corelib/global/qtypes.cpp
@@ -392,6 +392,7 @@ static_assert(std::numeric_limits<float>::radix == 2,
static_assert(sizeof(size_t) == sizeof(void *), "size_t and a pointer don't have the same size");
static_assert(sizeof(size_t) == sizeof(qsizetype)); // implied by the definition
static_assert((std::is_same<qsizetype, qptrdiff>::value));
+static_assert(std::is_same_v<std::size_t, size_t>);
// Check that our own typedefs are not broken.
static_assert(sizeof(qint8) == 1, "Internal error, qint8 is misdefined");
diff --git a/src/corelib/text/qanystringview.h b/src/corelib/text/qanystringview.h
index 7f8b1d6155..f8660b4d2b 100644
--- a/src/corelib/text/qanystringview.h
+++ b/src/corelib/text/qanystringview.h
@@ -33,8 +33,6 @@ public:
typedef qptrdiff difference_type;
typedef qsizetype size_type;
private:
- static_assert(std::is_same_v<std::size_t, size_t>);
- static_assert(sizeof(size_t) == sizeof(qsizetype));
static constexpr size_t SizeMask = (std::numeric_limits<size_t>::max)() / 4;
#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED)
static constexpr int SizeShift = 2;