C++ Logo

std-proposals

Advanced search

Re: [std-proposals] string_view support for std::stoi and friends

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Mon, 13 Jan 2025 20:59:49 +0000
> Why not change std::stoi to be that one-liner, which is almost what's being proposed?

Not saying that you can’t do that. But the standard is big enough as it is, you don’t need to duplicate the same algorithms to the same thing in a different way.

<charconv> already covers almost all cases, you can use it with a view, it covers more int types than stoi/stoull family does, it covers floats.
The only thing that it doesn’t cover as a use case is buffer size estimates (which nothing in the standard does).

Received on 2025-01-13 20:59:52