llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.24k stars 12.07k forks source link

P0067R5: Elementary string conversions #99940

Open cjdb opened 4 months ago

cjdb commented 4 months ago

Link: https://wg21.link/p0067r5

BEGIN-RST-NOTES
``std::(to|from)_chars`` for integrals has been available since version 7.0. ``std::to_chars`` for ``float`` and ``double`` since version 14.0 ``std::to_chars`` for ``long double`` uses the implementation for ``double``.
END-RST-NOTES
llvmbot commented 4 months ago

@llvm/issue-subscribers-c-17

Author: Christopher Di Bella (cjdb)

h-vetinari commented 4 months ago

I'm glad there are finally issues for these topics; that makes it much easier to collect publicly available information about them, rather have them scattered in the heads of core libcxx contributors.

Also some context I had kept from long ago

@h-vetinari: Stumbled over this while looking for the status of P0067R5; took me a while to unearth some old comments on this topic in https://reviews.llvm.org/D70631:

@h-vetinari: I was under the impression that https://github.com/llvm/llvm-project/commit/87c016078ad72c46505461e4ff8bfa04819fe7ba did most of the work for from_chars?

@mordante: Thanks for both links I wasn't aware of this effort! At the moment I'm too busy with <format> to look at from_chars, but this is useful when somebody starts working on from_chars. (I might look at it when I finished the larger projects I'm working on.)

lemire commented 2 months ago

The from_chars issue could be largely solved with https://github.com/fastfloat/fast_float

It is what GCC/glibc++ does.

I also left a comment in https://github.com/llvm/llvm-project/issues/92711

I'd be happy to help.

h-vetinari commented 1 week ago

The implementation of the remaining bits landed in #91651, which completes this paper except for long-double support (needs #113237). Feature test macro wasn't set yet.

frederick-vs-ja commented 2 days ago

Looks like that we're now very close to setting FTM on long double-eq-double platforms.