Re: Fall back to fast_float when C++ stdlib doesn't provide from_chars for floats

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Thu, 08 Aug 2024 19:00:19 UTC
On 8 Aug 2024, at 19:56, Daniel Tameling <tamelingdaniel@gmail.com> wrote:
> 
> On Tue, Aug 06, 2024 at 11:26:26AM +0100, Nuno Teixeira wrote:
>> 
>> As I don't have skills to understand why this fix works, I'd like to have
>> some expert opinion on this fix since I don't know if this will be
>> supported in the future.
> 
> Not an expert, but here is my opinion: the workaround uses the strtod
> function instead of the from_chars function. The latter got added in
> c++17 and the former is still in the latest standard, and I don't
> think it will be removed any time soon. So as long as it is supported
> by upstream, it should be save to use the workaround.
> 
> You might want to raise the issue with toolchain@FreeBSD.org to get a
> reaction from the real experts. Maybe there is a better solution to
> your problem.

At the moment, from_chars is only implemented for integers, in libc++.
I'm unsure what the reason is for not implementing it for floating point
types.

So for now, just use strtod() or the equivalent.

-Dimitry