docopt.cpp
docopt.cpp copied to clipboard
replacing std::regex with ctre
I replaced std::regex with https://github.com/hanickadot/compile-time-regular-expressions . In doing so I had to add a .clang-format, remove boost regex, and move the standard to c++17 (this last one is a hard requirement for ctre). Is there an interest in these changes, or is it out of scope for this project?
you can find my fork here: https://github.com/andijcr/docopt.cpp/tree/feat/ctre
I would vote for it because std::regex of Microsoft Visual C++ has mayn issues. The one you'll hit very soon is: Grouping within repetition causes regex stack error However, I would prefer a plugable regex approach allowing to add your own regex library. For instance PCRE.
I do like this idea ... does it all work ok with CTRE? Whats the compile time change?
I opened a pull request to compare the changes. The important changes are in this commit https://github.com/andijcr/docopt.cpp/commit/ca98f8496e0728371af5b0ae8a3fb26f1d3e4892 The compile time tends to be worse than before, but it's limited only to a translation unit of the library, so it's a price paid only once when at the first build. The major problem it's the hard requirement for c++20, but since the changes are localized I think some ifdefs should be able to handle it.