C++ Logo

SG14

Advanced search

Subject: Re: [isocpp-lib] Why is <charconf> not in freestanding (in 17) yet?
From: Ben Craig (ben.craig_at_[hidden])
Date: 2020-03-20 08:08:39


P0829 (the old omnibus paper) recommends making the integer overloads freestanding. I haven't made a smaller, split out paper for charconv yet.

For the floating point overloads, there are two major challenges.

First, is the floating point part. It is my (weakly held) opinion that floating point functions shouldn't be required in freestanding, because you can't portably use floating point in some environments, notably many OS kernels.
Second is the space overhead. The implementations that I'm aware of have a high space cost, that isn't suitable on many embedded platforms. This is in addition to the space cost for floating point emulation (where needed). The charconv floating point functions are pretty awesome, but binary size isn't one of their strengths.

> -----Original Message-----
> From: Lib <lib-bounces_at_[hidden]> On Behalf Of Peter Sommerlad
> (C++) via Lib
> Sent: Friday, March 20, 2020 7:58 AM
> To: Game Dev/Financial/Trading/Simulation/Embedded Devices
> <sg14_at_[hidden]>
> Cc: Peter Sommerlad (C++) <peter.cpp_at_[hidden]>; Library Working
> Group <lib_at_[hidden]>
> Subject: [EXTERNAL] [isocpp-lib] Why is <charconf> not in freestanding (in
> 17) yet?
>
> Hi,
>
> I thought one of the reason we got from_chars and to_chars functions was
> to provide low-level facilities for these conversions that could be run on small
> devices, where iostreams/stringstream would not be beneficial.
>
> So I got confused that those functions were put in <utility> in C++17 and thus
> not available for freestanding implementations.
>
> I am asking, because they would allow safety guidelines to stop programmers
> to DIY conversions. (e.g. banning all arithmetic on character types).
>
> I did not check the 20 draft yet.
>
> Thanks for help
>
> Peter.
>
> --
> Peter Sommerlad
>
> Better Software: Consulting, Training, Reviews Modern, Safe & Agile C++
>
> peter.cpp_at_[hidden]
> +41 79 432 23 32
> _______________________________________________
> Lib mailing list
> Lib_at_[hidden]
> Subscription:
> https://urldefense.com/v3/__https://lists.isocpp.org/mailman/listinfo.cgi/lib
> __;!!FbZ0ZwI3Qg!7dBcgpDMrSu2B_6kXOsC5di-
> j3AZRIbQ8fU1oyR7vQTJknz18oNwkrtM9-da$
> Link to this post:
> https://urldefense.com/v3/__http://lists.isocpp.org/lib/2020/03/15665.php_
> _;!!FbZ0ZwI3Qg!7dBcgpDMrSu2B_6kXOsC5di-
> j3AZRIbQ8fU1oyR7vQTJknz18oNwkjs2Mplz$


SG14 list run by sg14-owner@lists.isocpp.org

Older Archives on Google Groups