Open zejal opened 4 months ago
It is difficult to discuss these things in the abstract. My recommendation is that you make a pull request and we can look at the code.
Not hugely familiar with github at this stage, unfortunately. Based on last released fast_float.hpp you'd have:
template<typename T, typename UC>
FASTFLOAT_CONSTEXPR20
from_chars_result_t<UC> from_chars_advanced(const parsed_number_string_t<UC>& pns, T &value) noexcept {
// assert pns.valid ? or explicit check as in current function ? probably leave the check responsibility to caller ?
answer.ec = std::errc(); // be optimistic
// same lines as in existing from_chars_advanced.
// ...
}
@zejal Can you propose a patch?
Sure, I'll do my best to get familiar with how github works to work on changes.
Idea would be to allow for existing parsing code and avoid copy pasting remainder of from_chars_advanced function. Existing parser code would fill the parsed_number_string structure as appropriate.