QtCS2024 std::format

From Qt Wiki
Revision as of 12:02, 5 September 2024 by Thiago Macieira (talk | contribs)
Jump to navigation Jump to search

Session Summary

In this session we'll discuss std::format and its support in Qt.

We'll try to discuss sevaral main questions:

  • Which Qt types should support formattings with std::format?
  • Do we limit ourselves with the standard format specifiers, or do we allow custom specifiers?
  • Implementation details


Bonus topic:

Do we need an alternative to QString::arg() with std::format-like syntax?

Session Owners

Ivan

Notes

  • We would like to have support for std::format for our printable types (already supported in QDebug) so users don't have to define them locally
    • would clash later if we decided to add them
  • Does it make sense for all types?
    • QDebug can print almost anything but doesn't guarantee what it will print (it just has to be useful)
    • Should std::format reuse all of that? Should we guarantee what the output will be and retain it? Might make it impossible to use QDebug instead.