serge-sans-paille / frozen

a header-only, constexpr alternative to gperf for C++14 users
Apache License 2.0
1.27k stars 103 forks source link

Boyer-Moore checks #144

Closed RazielXYZ closed 1 year ago

RazielXYZ commented 1 year ago

It seems that at some point in time, assigning a string iterator a value past-the-end of the string became quite illegal, at least in MSVC's STL. As such, the Boyer-Moore search would throw, including in one of the existing tests (the one expecting the needle to not be found). As such, I've added extra checks to ensure no iterator is ever set past last in there. I've also added a few extra tests to check for such edge cases that would set any iterator past-the-end as well.

serge-sans-paille commented 1 year ago

Thanks a lot for this PR!