Date: Tue, 29 Apr 2025 10:13:49 +0200
I think the best approach would be to propose the minimal interface, and
then multiple levels of convenience on top of that, and see what LEWG is
comfortable with.
- Level 0 would be the function I've shown, just taking the integer and
fraction digits, and the pre-parsed exponent.
- Level 1 would additionally take the exponent digits and sign, in case
the user doesn't want to preparse the exponent.
- Level 2 would additionally take a character which is ignored anywhere,
to enable digit separators
I'm not sure where leading sign characters would come in, or if they're
worth supporting at all. The user can just as easily call std::copysign
afterwards as passing the sign into std::parse_float, so it appears to be
of no value.
There are a few adjacent problems, like making the thing constexpr, but
that should be done in sync with making std::from_chars constexpr, and it's
a separate issue. Supporting char8_t, char16_t, and char32_t are also
adjacent issues and should be done in sync with std::from_chars.
Anyhow, if you'd like to co-author, I'd be happy with that. I'll send some
more details by the end of the week.
then multiple levels of convenience on top of that, and see what LEWG is
comfortable with.
- Level 0 would be the function I've shown, just taking the integer and
fraction digits, and the pre-parsed exponent.
- Level 1 would additionally take the exponent digits and sign, in case
the user doesn't want to preparse the exponent.
- Level 2 would additionally take a character which is ignored anywhere,
to enable digit separators
I'm not sure where leading sign characters would come in, or if they're
worth supporting at all. The user can just as easily call std::copysign
afterwards as passing the sign into std::parse_float, so it appears to be
of no value.
There are a few adjacent problems, like making the thing constexpr, but
that should be done in sync with making std::from_chars constexpr, and it's
a separate issue. Supporting char8_t, char16_t, and char32_t are also
adjacent issues and should be done in sync with std::from_chars.
Anyhow, if you'd like to co-author, I'd be happy with that. I'll send some
more details by the end of the week.
Received on 2025-04-29 08:14:07