From a5752f4cb4c5d1717fa7c431b9e531f72225571c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 4 Sep 2024 15:32:26 +0200 Subject: [PATCH] QUtf8StringView: fix missing inline keywords MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This probably wasn't triggering anything, because the class happens to be a template, but don't let the poor guy that will de-templatize this come Qt 7 run into this. Also add the customary "defined in qstring.h" comment. Found in API-review. Amends 3d0eaf863edeed9095b35026974a54cc7d418962, 9b945b381a78b56b14d46ec314f0f69264ac0602, 4c931155043af6bbd9c36475fa8d3cb14e65f644 and b977ae371a753a82e1d0bb32c5b62099da663721. Change-Id: I45b2a808dca5ea335a1771df9cfeb4e67bd185f3 Reviewed-by: Thiago Macieira Reviewed-by: Øystein Heskestad (cherry picked from commit 183a775f80a029136416c75a66f74e4c099e0d32) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/text/qutf8stringview.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/corelib/text/qutf8stringview.h b/src/corelib/text/qutf8stringview.h index 6f0894e2922..9c74efb685b 100644 --- a/src/corelib/text/qutf8stringview.h +++ b/src/corelib/text/qutf8stringview.h @@ -298,19 +298,21 @@ public: return QtPrivate::compareStrings(*this, other, cs); } - [[nodiscard]] int compare(QChar other, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept; - [[nodiscard]] int compare(QStringView other, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept; - [[nodiscard]] int compare(QLatin1StringView other, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept; - [[nodiscard]] int compare(const QByteArray &other, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept; + // all defined in qstring.h + [[nodiscard]] inline int compare(QChar other, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept; + [[nodiscard]] inline int compare(QStringView other, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept; + [[nodiscard]] inline int compare(QLatin1StringView other, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept; + [[nodiscard]] inline int compare(const QByteArray &other, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept; - [[nodiscard]] bool equal(QChar other) const noexcept; - [[nodiscard]] bool equal(QStringView other) const noexcept; - [[nodiscard]] bool equal(QLatin1StringView other) const noexcept; - [[nodiscard]] bool equal(const QByteArray &other) const noexcept; + [[nodiscard]] inline bool equal(QChar other) const noexcept; + [[nodiscard]] inline bool equal(QStringView other) const noexcept; + [[nodiscard]] inline bool equal(QLatin1StringView other) const noexcept; + [[nodiscard]] inline bool equal(const QByteArray &other) const noexcept; + // end defined in qstring.h [[nodiscard]] static constexpr qsizetype maxSize() noexcept {