yhirose / cpp-peglib

A single file C++ header-only PEG (Parsing Expression Grammars) library
MIT License
900 stars 112 forks source link

Remove charconv requirement #142

Closed nsmith- closed 3 years ago

nsmith- commented 3 years ago

It's apparently a very restrictive c++17 compiler support requirement (gcc 8.1, clang 7) This is just a proposal, feel free to reject. One could also use a macro to switch the code based on compiler version.

yhirose commented 3 years ago

@nsmith-, since I don't have old compilers working on my machine, could you try with #if __has_include(<charconv>) instead of using compiler version macro? Thanks.

nsmith- commented 3 years ago

I'll test it out and add. A helpful tool I came across is https://godbolt.org/z/qx84oz which allows to compile small programs in a variety of compilers. That tool seems to indicate that most compilers accept this flag

nsmith- commented 3 years ago

This works in the build environment I had issue with previously (g++ 7.4 clang++ 7.1)

yhirose commented 3 years ago

@nsmith-, thanks for our contribution!