Skip to content

Commit

Permalink
Make operator""_ls an alias for Qt::operator""_L1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
KitsuneRal committed Aug 25, 2024
1 parent 8b7a27c commit ba5e93b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Quotient/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ template <typename KeyT, typename ValT>
using UnorderedMap
[[deprecated("Use std::unordered_map directly")]] = std::unordered_map<KeyT, ValT, HashQ<KeyT>>;

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 <typename ArrayT>
Expand Down

0 comments on commit ba5e93b

Please sign in to comment.