stoi (stoll ...) accept string_view [insted of] string

305 views
Skip to first unread message

yanp...@gmail.com

unread,
Mar 15, 2017, 11:54:57 AM3/15/17
to ISO C++ Standard - Future Proposals
I suggest adding string_view overloads to this group of functions. I guess the reason why is obvious.

Nicol Bolas

unread,
Mar 15, 2017, 12:08:06 PM3/15/17
to ISO C++ Standard - Future Proposals, yanp...@gmail.com
On Wednesday, March 15, 2017 at 11:54:57 AM UTC-4, yanp...@gmail.com wrote:
I suggest adding string_view overloads to this group of functions. I guess the reason why is obvious.

Personally, I'd rather have `string_view` overloads of the `from_chars` functions. Let `stoi` and its ilk die.

yanp...@gmail.com

unread,
Mar 15, 2017, 12:52:59 PM3/15/17
to ISO C++ Standard - Future Proposals, yanp...@gmail.com
I don't see any replacement for stoi. It is compact instead of from_chars and strtol; handles errors (via exceptions, which are hated by some devs), handier than streams.

среда, 15 марта 2017 г., 19:08:06 UTC+3 пользователь Nicol Bolas написал:
Reply all
Reply to author
Forward
0 new messages