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<QByteArray, ~~~>, with incompatible formatting flags
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 QByteArray/View, will write other tickets for other Qt types.
Acceptance criteria:
- QByteArray/View work in std::format with some custom formatting flags, e.g.
- printing in hex (toHex())
- in base64 (toBase64Encoding())
- in percent-encoding ({{toPercentEncoding()}))
- ...
Attachments
Issue Links
- relates to
-
QTBUG-99499 [QByteArrayView] missing converters
- Open
-
QTBUG-104652 As a user of Qt, I'd like to be able to std::format Qt's string (view) types (ex QByteArray(View))
- Open