From ba5e93bcd4c8034d440ea60ff7da0106f95661fd Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 23 Apr 2024 08:32:13 +0200 Subject: [PATCH] Make operator""_ls an alias for Qt::operator""_L1 Now that Qt has its own string literals, we don't need to keep ours any more. Not deprecating ""_ls yet, as it's used basically everywhere and the best replacement (""_L1 or u""_s) depends on the particular API that usually prefers QStrings but in some cases (QJson*) supports both single-byte and double-byte strings on par. --- Quotient/util.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Quotient/util.h b/Quotient/util.h index c6ae7036a..5bbdef810 100644 --- a/Quotient/util.h +++ b/Quotient/util.h @@ -101,9 +101,12 @@ template using UnorderedMap [[deprecated("Use std::unordered_map directly")]] = std::unordered_map>; -constexpr auto operator"" _ls(const char* s, std::size_t size) +inline namespace Literals { using namespace Qt::Literals; } + +// [[deprecated("Use operators from Qt::Literals (aka Quotient::Literals) instead")]] +constexpr auto operator""_ls(const char* s, std::size_t size) { - return QLatin1String(s, int(size)); + return operator""_L1(s, size); } template