You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did notice that the integer and floating-point routines parsing are home-grown. They do seem to perform well and handle common values well, but it's easy to see places where they'd break down.
I faced the same problem and settled on fast_float for floats and std::from_chars for integers. The former has basically the same performance as read_fp, but can be considered correct (including error checking!). It's already been, or soon will be, included in all the major compilers. The latter has basically universal compiler support. I don't see a minimum C++ standard declaration anywhere, so I assume C++17 is ok.
The text was updated successfully, but these errors were encountered:
This is a great suggestion. For the systems that this library was built for (and currently used on), C++11 through older compilers is all that is available. However, from_chars and fast_float would be perfect for those that can use it. The current plan is to develop a parameter that can allow different character and float parsing to be used, with the homegrown one an option available for those that do not have access to other implementations.
fast_float itself is C++11, it just uses an interface similar to the C++17 routines. Only std::from_chars requires C++17.
I'm noticing not too much downside with strtol and friends for integers, though I bet your homegrown is faster. I'm too paranoid of missing some edgecases to use a homegrown solution. For example the homegrown does not appear to detect overflow. That's probably a worthwhile tradeoff for many users though.
Great library!
I did notice that the integer and floating-point routines parsing are home-grown. They do seem to perform well and handle common values well, but it's easy to see places where they'd break down.
I faced the same problem and settled on fast_float for floats and
std::from_chars
for integers. The former has basically the same performance asread_fp
, but can be considered correct (including error checking!). It's already been, or soon will be, included in all the major compilers. The latter has basically universal compiler support. I don't see a minimum C++ standard declaration anywhere, so I assume C++17 is ok.The text was updated successfully, but these errors were encountered: