On Sun, Nov 25, 2012 at 5:24 PM, Beman Dawes <
bda...@acm.org> wrote:
> On Sat, Nov 24, 2012 at 9:48 AM, Olaf van der Spek <
olafv...@gmail.com> wrote:
>> Just wondering, why is stoui missing?
>
> There is no rationale in the proposal, which is by Pete Becker. It
> looks like it be an oversight.
Maybe not. These functions are based on the C functions strtol,
strtoll, strtoul and strtoull. Note both strtoi and strtoui are
missing. I wonder what happens if sizeof(int) < sizeof(long) and stoi
is called with an argument that's in range for long but not for int.
> If no one else chimes in with rationale, you might want to file a library issue.
Even with rationale filing an issue seems appropriate.
Is this policy documented somewhere?
> Non-throwing variants are only provided when there is a
> strong case that errors aren't exceptional for the function. You can
> always file an issue, but I'd be surprised if it got enough support to
> pass.
Really? Errors are to be expected when parsing (user) input, aren't they?
"int i; cin >> i;" doesn't throw (by default)
Thx! Isn't there a HTML variant though? Linking to specific sections
would be handy.
--
Olaf