C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Should std::to_string be deprecated?

From: Edward Catmur <ecatmur_at_[hidden]>
Date: Thu, 5 Oct 2023 14:20:05 -0600
On Thu, 5 Oct 2023 at 14:03, Giuseppe D'Angelo via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On 05/10/2023 15:13, Jonathan Sweemer via Std-Proposals wrote:
> > If there is a generic version of std::to_string then it should produce
> > the same result as std::format, no?
>
> Which then also raises the question, is there a concept that doesn't
> simply check that a type is formattable, but that it's formattable with
> "{}"?
>
>
Not in the standard. It could be written:

std::formattable<T, char> and [](std::format_parse_context pc) {
    return std::formatter<T>().parse(pc) == pc.end();
}(std::format_parse_context(std::string_view()))

Received on 2023-10-05 20:20:18