Date: Mon, 28 Apr 2025 16:36:07 +0200
To clarify the Ada example, Ada hex floats would look like "16#F.FF#E+2",
so to parse it, rather than "just doing it", you would need to build a new
string with 16# and and the # before E removed, and then std::from_chars
can accept it.
However, you need a brand new buffer to do this (assuming that your parse
function takes a string_view or something), and as I've said, that may be
tricky. By the time you've parsed the number, you already know where the
integer, fractional, and exponent digits are anyway, so your life would be
a lot easier if you could "just do it" at that point instead of doing a
pointless ritual to make std::from_chars happy.
>
so to parse it, rather than "just doing it", you would need to build a new
string with 16# and and the # before E removed, and then std::from_chars
can accept it.
However, you need a brand new buffer to do this (assuming that your parse
function takes a string_view or something), and as I've said, that may be
tricky. By the time you've parsed the number, you already know where the
integer, fractional, and exponent digits are anyway, so your life would be
a lot easier if you could "just do it" at that point instead of doing a
pointless ritual to make std::from_chars happy.
>
Received on 2025-04-28 14:36:25