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
> 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?
> 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 Sommerlad
> Better Software: Consulting, Training, Reviews Modern, Safe & Agile C++
> +41 79 432 23 32
> Lib mailing list
> Link to this post:
SG14 list run by firstname.lastname@example.org
Older Archives on Google Groups