Date: Mon, 13 Jan 2025 22:40:14 +0000
Yes, it does more.
But it also does more than it should, more than what people want to do with it, but not always what you want to do with it.
And that's the crux of it. Hence why it's my opinion that it is obsolete, it does things slightly different and that's why it performs poorly and can't be simply patched up in the future, when more often than not what you want to do <charconv> does it and does it better.
Syntax might not be the best... but what it does with it almost is.
________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf of Thiago Macieira via Std-Proposals <std-proposals_at_[hidden]>
Sent: Monday, January 13, 2025 10:41:58 PM
To: std-proposals_at_[hidden] <std-proposals_at_[hidden]>
Cc: Thiago Macieira <thiago_at_[hidden]>
Subject: Re: [std-proposals] string_view support for std::stoi and friends
On Monday 13 January 2025 12:51:51 Pacific Standard Time Jonathan Wakely via
Std-Proposals wrote:
> Why not change std::stoi to be that one-liner, which is almost what's being
> proposed?
Because it isn't. And that's the issue: stoi does more than just parse the
numbers. It also handles whitespace before the number, the plus sign, and 0,
0b and 0x prefix for when applicable for the base in question.
But it also does more than it should, more than what people want to do with it, but not always what you want to do with it.
And that's the crux of it. Hence why it's my opinion that it is obsolete, it does things slightly different and that's why it performs poorly and can't be simply patched up in the future, when more often than not what you want to do <charconv> does it and does it better.
Syntax might not be the best... but what it does with it almost is.
________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf of Thiago Macieira via Std-Proposals <std-proposals_at_[hidden]>
Sent: Monday, January 13, 2025 10:41:58 PM
To: std-proposals_at_[hidden] <std-proposals_at_[hidden]>
Cc: Thiago Macieira <thiago_at_[hidden]>
Subject: Re: [std-proposals] string_view support for std::stoi and friends
On Monday 13 January 2025 12:51:51 Pacific Standard Time Jonathan Wakely via
Std-Proposals wrote:
> Why not change std::stoi to be that one-liner, which is almost what's being
> proposed?
Because it isn't. And that's the issue: stoi does more than just parse the
numbers. It also handles whitespace before the number, the plus sign, and 0,
0b and 0x prefix for when applicable for the base in question.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel DCAI Platform & System Engineering -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-01-13 22:40:21