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>
bb10
Thiago Macieira 2022-12-04 11:41:25 -08:00 committed by Marc Mutz
parent 8be744df8a
commit e02933a17c
2 changed files with 1 additions and 2 deletions

View File

@ -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");

View File

@ -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;