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

Jonathan Wakely jwakely.gcc@gmail.com
Mon Jun 22 22:59:23 GMT 2020


On Mon, 22 Jun 2020 at 22:05, Evgeniy Dushistov <dushistov@mail.ru> wrote:
>
> 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.

Yes, that's all my implementation does, but as you say, it's nice to
have a single call that does it for you.


More information about the Libstdc++ mailing list