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

As a user of QStringBuilder, I'd like to use the framework for other strings, not just QString and QByteArray

    XMLWordPrintable

Details

    • User Story
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • None

    Description

      We use a lot of Qt in our projects, but ever since QStringView was introduced, we have slowly changed some of our code to use std::u16string, esp. where very short strings are common (when will QString get SSO? ), or where we can make good use of the pmr version. One thing we find is that when we do the change, apart from the usual Qt-API-to-STL-API ports (you know, isEmpty() -> empty(), qsizetype -> size_t, etc), we run into the problem that while QStringBuilder accepts u16string (if we wrap it in QStringView) on the RHS, it doesn't work on the LHS of an expression, even though the used API subset (reserve(), size(), capacity(), data(), resize()) is available on std::u16string, too.

      It would be nice if the feature could be used to produce std::u16string (incl. pmr versions, please) and, say, QVarLengthArray<char16_t>, too. Icing on the cake would be if it would work with every container that has a compatible value_type and provides the requires API subset.

      Attachments

        Issue Links

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

          Activity

            People

              cnn Qt Core & Network
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes