C++ Logo

std-proposals

Advanced search

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

From: Victor Zverovich <victor.zverovich_at_[hidden]>
Date: Wed, 4 Oct 2023 13:38:37 -0700
I am an author of P2587 and I think that now that the two APIs are more
consistent there are fewer reasons to deprecate std::to_string, not more.
At the very least std::to_string is a useful shorthand notation for
std::format for numeric types.

Cheers,
Victor

On Wed, Oct 4, 2023 at 5:26 AM Jonathan Sweemer via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Hello,
>
> I recently came across P2587 "to_string or not to_string", which has been
> accepted for C++26, and I am wondering whether there has since been any
> attempt to deprecate std::to_string?
>
> The motivation would be to consolidate on std::format, which
> std::to_string is now (as of C++26) defined in terms of, thereby making the
> standard library marginally smaller and easier to teach (in my opinion).
>
> If this is a stupid idea, then can you kindly inform me of the role that
> std::to_string is intended to play in the language for C++26 and beyond?
>
> Thanks,
> Jonathan Sweemer
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2023-10-04 20:38:50