What's the status of to_chars/from_chars for floating-point types?

Evgeniy Dushistov dushistov@mail.ru
Mon Jun 22 21:05:47 GMT 2020


On Mon, Jun 22, 2020 at 09:57:52PM +0100, Jonathan Wakely wrote:
> > > > > The C++17 functions to_chars and from_chars have been implemented for
> > > > > integer types quite a long time. Until recently, there were no
> > > > > implementations of their floating-point versions in major compilers.
> > > > > Now that STL has implemented these functions completely in MSVC, I
> > > > > wonder what their current status is in GCC.
> > > >
> > > > I have an implementation of from_chars for float/double/long double.
> > >
> > > Any update for this? Even from_chars alone would be great.
> > > There is already charconv with float/double support in msvc STL:
> > > https://github.com/microsoft/STL/blob/04cf94886aa749b3bc4233762db517336776b1fa/stl/inc/charconv
> > > and also ongoing efforts to include this implementation to libc++:
> > > https://reviews.llvm.org/D70631
> >
> > The libstdc++ implementation will be based on Ryu too, but it doesn't exist yet.
> 
> I can add from_chars this week though.

It would be great, replacing strtof/strtod plus setlocale/newlocale magic
to just to one call would simplify things.

-- 
/Evgeniy


More information about the Libstdc++ mailing list