Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-134136

Complete Q*StringView literals

XMLWordPrintable

    • 13
    • 874be50e7 (dev)
    • Foundation PM Staging

      Following QTBUG-123851, we need literals for QUtf8StringView and QByteArrayView, too.

      We should also add them for QASV, needs a different suffix, though, and the use of the QASV one should guarantee that L1 detection is done at compile-time (not like QTBUG-101014, which is only taking affect when assigning the QASV to a constexpr variable).

      Open questions:

      • what is ""_sv? A QByteArrayView or a QUtf8StringView (u8""_sv should be the latter, of course, so C++17/20 compat suggests that it be a QUtf8StringView). So ""_bav for QByteArrayView?
      • what is the name of the UDLs for QAnyStringView? If C++ had template <char...> auto operator""_sv we could check in there for US-ASCII and return L1 or U8, depending on encoding, but that operator is only available for float/int literals; could maybe play tricks with passing the string as a non-type template argument, but that's probably C++20? Looks like we need _asv?

        For Gerrit Dashboard: QTBUG-134136
        # Subject Branch Project Status CR V

            peppe Giuseppe D'Angelo
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change