<regex>: Compare against char directly by StephanTLavavej · Pull Request #5675 · microsoft/STL (original) (raw)
Fixes #5673 and fixes VSO-2548012 in conjunction with small Build2 changes.
Build2 is doing something extremely complicated and fragile with user-defined character types and regex. When we construct user-defined _Elem from ordinary chars, that triggers assertions in their machinery, even though the resulting homogeneous comparisons between _Elem and _Elem are arguably more cromulent.
This PR slightly backs off from the purity of such comparisons, resulting in code that's somewhat closer to our old way of doing things, but still avoiding the internal _Uelem machinery. Now we directly compare _Elem to char. Build2 has heterogeneous comparison operators that handle this.
It will still be necessary to update Build2 to round-trip their user-defined character type instead of asserting, but that's a less invasive change: build2/build2#478
This makes no difference to the vast, vast majority of users who simply use char or wchar_t.