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

Complete Q*StringView literals

    XMLWordPrintable

Details

    Description

      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?

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes