Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Aug 2024 21:00:19 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Daniel Tameling <tamelingdaniel@gmail.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Fall back to fast_float when C++ stdlib doesn't provide from_chars for floats
Message-ID:  <9C549977-BC84-4B46-9F11-2EE70CF4CF27@FreeBSD.org>
In-Reply-To: <ZrUG4nXzfPRDRbHV@mail.gmail.com>
References:  <CAFDf7UJwwRQZpYgTij_3r4x0D3E-MjR9vNk7fNfvfG9Y0JSmUg@mail.gmail.com> <ZrUG4nXzfPRDRbHV@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

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



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9C549977-BC84-4B46-9F11-2EE70CF4CF27>