Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
valid/in-enum
for C++98, fix MSVC compat for C++11
Fixes the ValidFailInEnum test for C++98. Should also fix EnumIntRangeU and EnumLongRange{S,U} for `cpp_stl_11/msvc141-windows-x64`. I haven't tested these locally, but if this change doesn't fix them, I don't know what would. Instead of creating a set of integers that the enum represents, this commit creates a set of the defined enum values themselves. This should be more portable, as the code no longer needs to take into account what integer type is the underlying type of the enum (despite my best efforts, the existing approach didn't work in MSVC anyway for large integer enum values, so the new approach seems to be the only way to make it work on MSVC). Also, given that it was no longer necessary to use `std::underlying_type` (which is only available since C++11), this adds support for C++98. It required a workaround for the missing initializer lists, but the result doesn't look too bad.
- Loading branch information