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

As a user of Qt, I'd like to be able to std::format Qt's string (view) types (ex QByteArray(View))

    XMLWordPrintable

Details

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

    Description

      TL;DR: see epic for up-to-date implementation advice

      We come from the near future and are porting our code to the new C++20 std::format library. We also use Qt, and have so far just written the std::formatter's ourselves, but a certain mmutz tells us that we mustn't, because we control neither the Qt types nor the std ones. And just as we were absorbing this advice, all hell broke lose when we added a new 3rd-party library that also added std::formatter<QString, ~~~>

      So, we have concluded that it's your job, dear Qt people, to provide these std::formatter specialisations for all the Qt types.

      This ticket is for the Qt string types, will write other tickets for other Qt types.

      Acceptance criteria:

      • Qt string (view) types work in std::format the same way as the std string (view) types
      • QByteArray(VIew) is not a string, but it would be cool to have some additional formatting options for outputting it, like hex, or base64... so, QByteArrayView isn't in-scope for this (→ QTBUG-104653)

      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