mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
wow, msvc not follow standard
This commit is contained in:
parent
52f36fc5a0
commit
2f9400bcf3
2 changed files with 4 additions and 0 deletions
|
|
@ -97,9 +97,11 @@ int main() {
|
|||
static_assert(magic_enum::is_scoped_enum_v<Flags>);
|
||||
|
||||
// Checks whether type is an Fixed enumeration.
|
||||
#if defined(_MSC_VER) && _MSC_VER != 1923 // MSVC bug, we can not check is enum fixed
|
||||
static_assert(!magic_enum::is_fixed_enum_v<color>);
|
||||
static_assert(magic_enum::is_fixed_enum_v<Color>);
|
||||
static_assert(magic_enum::is_fixed_enum_v<Flags>);
|
||||
#endif
|
||||
|
||||
// Enum pair (value enum, string enum name) sequence.
|
||||
constexpr auto color_entries = magic_enum::enum_entries<Color>();
|
||||
|
|
|
|||
|
|
@ -454,10 +454,12 @@ TEST_CASE("type_traits") {
|
|||
REQUIRE_FALSE(is_scoped_enum_v<Directions>);
|
||||
REQUIRE_FALSE(is_scoped_enum_v<number>);
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER != 1923 // MSVC bug, we can not check is enum fixed
|
||||
REQUIRE(is_fixed_enum_v<Color>);
|
||||
REQUIRE(is_fixed_enum_v<Numbers>);
|
||||
REQUIRE_FALSE(is_fixed_enum_v<Directions>);
|
||||
REQUIRE(is_fixed_enum_v<number>);
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_CASE("enum_traits") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue