Date: Mon, 01 Jul 2024 22:55:42 +0200
On Monday 1 July 2024 10:38:06 CEST Ivan Solovev wrote:
> I do agree that this makes sense for formatting into QString, as the
> standard does not provide any char16_t formatters anyway. That's something
> that we can further discuss in our Qt Development ML.
> However, I'm not sure that we need such approach for anything else. Users
> should be able to use std::format with Qt types, not some fancy wrapper
> function.
Indeed. If we provide the formatter for formatting into QString, then the
formatter may work on other outputs too.
But see the follow-up email where I am arguing that the formatting should be
almost entirely out-of-line to avoid code bloat. That actually means we don't
need to provide a formatter at all for the most common Qt types. We probably
will, but we don't have to.
> So, in my opinion the fact that std::formatter is missing the APIs to
> pre-allocate a buffer, and to write directly into it is still a problem
> that should be fixed for C++26. Not only Qt, but everyone writing
> formatters for custom types would benefit from it.
Agreed.
> I do agree that this makes sense for formatting into QString, as the
> standard does not provide any char16_t formatters anyway. That's something
> that we can further discuss in our Qt Development ML.
> However, I'm not sure that we need such approach for anything else. Users
> should be able to use std::format with Qt types, not some fancy wrapper
> function.
Indeed. If we provide the formatter for formatting into QString, then the
formatter may work on other outputs too.
But see the follow-up email where I am arguing that the formatting should be
almost entirely out-of-line to avoid code bloat. That actually means we don't
need to provide a formatter at all for the most common Qt types. We probably
will, but we don't have to.
> So, in my opinion the fact that std::formatter is missing the APIs to
> pre-allocate a buffer, and to write directly into it is still a problem
> that should be fixed for C++26. Not only Qt, but everyone writing
> formatters for custom types would benefit from it.
Agreed.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel DCAI Platform & System Engineering
Received on 2024-07-01 20:55:47