Qt UDLs: avoid the deprecated form of UDL definitions

cppreference.com says¹ that the space after the "" is deprecated now,
so remove the space. Let's just hope all our compilers support this,
otherwise it will get ugly².

¹ https://en.cppreference.com/w/cpp/language/user_literal#Literal_operators
² https://github.com/yhirose/cpp-httplib/issues/953

Pick-to: 6.6 6.5 6.2
Change-Id: Ic8e4939e3ba713023c5a5c020305c96b521dbda9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2023-09-08 17:17:17 +02:00
parent 83c2c50554
commit 5503b47893
4 changed files with 6 additions and 6 deletions

View File

@ -715,7 +715,7 @@ namespace Qt {
inline namespace Literals {
inline namespace StringLiterals {
inline QByteArray operator"" _ba(const char *str, size_t size) noexcept
inline QByteArray operator""_ba(const char *str, size_t size) noexcept
{
return QByteArray(QByteArrayData(nullptr, const_cast<char *>(str), qsizetype(size)));
}
@ -728,7 +728,7 @@ inline namespace QtLiterals {
#if QT_DEPRECATED_SINCE(6, 8)
QT_DEPRECATED_VERSION_X_6_8("Use _ba from Qt::StringLiterals namespace instead.")
inline QByteArray operator"" _qba(const char *str, size_t size) noexcept
inline QByteArray operator""_qba(const char *str, size_t size) noexcept
{
return Qt::StringLiterals::operator""_ba(str, size);
}

View File

@ -627,7 +627,7 @@ namespace Qt {
inline namespace Literals {
inline namespace StringLiterals {
constexpr inline QLatin1Char operator"" _L1(char ch) noexcept
constexpr inline QLatin1Char operator""_L1(char ch) noexcept
{
return QLatin1Char(ch);
}

View File

@ -352,7 +352,7 @@ namespace Qt {
inline namespace Literals {
inline namespace StringLiterals {
constexpr inline QLatin1StringView operator"" _L1(const char *str, size_t size) noexcept
constexpr inline QLatin1StringView operator""_L1(const char *str, size_t size) noexcept
{
return {str, qsizetype(size)};
}

View File

@ -1488,7 +1488,7 @@ qsizetype erase_if(QString &s, Predicate pred)
namespace Qt {
inline namespace Literals {
inline namespace StringLiterals {
inline QString operator"" _s(const char16_t *str, size_t size) noexcept
inline QString operator""_s(const char16_t *str, size_t size) noexcept
{
return QString(QStringPrivate(nullptr, const_cast<char16_t *>(str), qsizetype(size)));
}
@ -1501,7 +1501,7 @@ inline namespace QtLiterals {
#if QT_DEPRECATED_SINCE(6, 8)
QT_DEPRECATED_VERSION_X_6_8("Use _s from Qt::StringLiterals namespace instead.")
inline QString operator"" _qs(const char16_t *str, size_t size) noexcept
inline QString operator""_qs(const char16_t *str, size_t size) noexcept
{
return Qt::StringLiterals::operator""_s(str, size);
}