diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2024-02-20 16:45:21 +0100 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2024-03-02 00:12:54 +0100 |
commit | a08bafc9205d0b67f71a1896ad84272eeb294374 (patch) | |
tree | 4d58531412a502a1d4aaa9b2404f61399d041f63 /src/corelib/text/qbytearrayview.h | |
parent | 34372af708cc2ed42ff8f533ca4700a2807555d9 (diff) |
Add QByteArrayView vs QChar and vs char16_t relational operators
This allows to remove the dummy relational operators from
tst_qstringapisymmetry.
Task-number: QTBUG-108805
Change-Id: I7cb3154d6fcb571cafab6b318806f74bc8300448
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qbytearrayview.h')
-rw-r--r-- | src/corelib/text/qbytearrayview.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/text/qbytearrayview.h b/src/corelib/text/qbytearrayview.h index 92c38e5ed4..85a68b14b2 100644 --- a/src/corelib/text/qbytearrayview.h +++ b/src/corelib/text/qbytearrayview.h @@ -347,6 +347,18 @@ private: { return compareThreeWay(lhs, QByteArrayView(rhs)); } Q_DECLARE_STRONGLY_ORDERED(QByteArrayView, const char *) + // defined in qstring.cpp + static bool + comparesEqual(const QByteArrayView &lhs, const QChar &rhs) noexcept; + static Qt::strong_ordering + compareThreeWay(const QByteArrayView &lhs, const QChar &rhs) noexcept; + static bool comparesEqual(const QByteArrayView &lhs, char16_t rhs) noexcept; + static Qt::strong_ordering compareThreeWay(const QByteArrayView &lhs, char16_t rhs) noexcept; +#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII) + Q_DECLARE_STRONGLY_ORDERED(QByteArrayView, QChar, QT_ASCII_CAST_WARN) + Q_DECLARE_STRONGLY_ORDERED(QByteArrayView, char16_t, QT_ASCII_CAST_WARN) +#endif // !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII) + qsizetype m_size; const storage_type *m_data; }; |