C++ Logo

std-proposals

Advanced search

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

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 14 Jan 2025 06:24:25 -0800
On Tuesday 14 January 2025 03:11:12 Pacific Standard Time tzsz via Std-
Proposals wrote:
> This isn't a real killer features. It is one of those convenience
> features like min, max, clamp, ceil that are easily implemented in a
> project but are still provided so developers don't have to do this over
> and over again.

Especially because it isn't that obvious to get right when you don't realise
what's missing. For example, the majority of number parsing does allow a plus
sign, but from_chars doesn't accept that. We don't want inconsistency between
uses because some people forgot about it. Likewise, space-padded numbers are
common, and skipping whitespace is a common feature too.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2025-01-14 14:24:30