tzlaine / parser

A C++ parser combinator library.
Boost Software License 1.0
81 stars 12 forks source link

Use `{from,to}_chars` instead of the Spirit X3 number parsers. #113

Closed tzlaine closed 6 months ago

tzlaine commented 7 months ago

This could be std:: or boost::charconv::, whichever is available.

tzlaine commented 7 months ago

I'm less hot on this idea after looking at from_chars:

std::from_chars_result
    from_chars( const char* first, const char* last,
                /* integer-type */& value, int base = 10 );

So for this to work, the parse input would need to be a common_range. Additionally, it would need to be chars, or a transcoding range that has chars at bottom.

Also, it would only have the same behavior when MinDigits and/or MaxDigits are not in use.

Ok, I guess it's not that limiting. I guess most input will be in chars, transcoded or not.