C++ Logo

std-proposals

Advanced search

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

From: Marcin Jaczewski <marcinjaczewski86_at_[hidden]>
Date: Wed, 4 Oct 2023 15:44:14 +0200
śr., 4 paź 2023 o 15:42 Andrey Semashev via Std-Proposals
<std-proposals_at_[hidden]> napisał(a):
>
> On 10/4/23 16:37, Ville Voutilainen wrote:
> > On Wed, 4 Oct 2023 at 16:35, Andrey Semashev via Std-Proposals
> > <std-proposals_at_[hidden]> wrote:
> >> Performance is one part of the issue, the other one is code size. Even
> >> if there is a fast path, you still have to link the entire
> >> implementation of std::format.
> >
> > ..but if that's templated and inlined and optimized, there's not much
> > code size bloat, is there?
>
> I haven't looked at the implementation, but I would expect at least some
> part of the parsing code to be precompiled. Otherwise, the code bloat
> would be immense, as effectively every instantiation of std::format
> would duplicate the same parsing code.
>
> But even templates need to be instantiated and code for them need to be
> generated. This is compile time and memory consumption. Whether that
> code will be eliminated by the optimizer is not guaranteed either (e.g.
> the optimizer could fail or the optimization could be disabled).
>

Using the as-if rule, it could be hand written and independent of
`std::format` but behave
exactly the same. This means no templates and code bloat. This is a QoI problem.


> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2023-10-04 13:44:27