From 105c8f067e5e251ed7b75826f11de4527945398b Mon Sep 17 00:00:00 2001 From: neargye Date: Wed, 2 Oct 2019 17:06:36 +0500 Subject: [PATCH] remove is_fixed_enum non stable and useless --- README.md | 1 - example/example.cpp | 7 ------- include/magic_enum.hpp | 15 --------------- test/test.cpp | 7 ------- 4 files changed, 30 deletions(-) diff --git a/README.md b/README.md index 7657398..c859e74 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ Header-only C++17 library provides static reflection for enums, work with any en * `enum_index` obtains index in enum value sequence from enum value. * `is_unscoped_enum` checks whether type is an [Unscoped enumeration](https://en.cppreference.com/w/cpp/language/enum#Unscoped_enumeration). * `is_scoped_enum` checks whether type is an [Scoped enumeration](https://en.cppreference.com/w/cpp/language/enum#Scoped_enumerations). -* `is_fixed_enum` checks whether type is an [Fixed enumeration](https://en.cppreference.com/w/cpp/language/enum). * `underlying_type` improved UB-free "SFINAE-friendly" [std::underlying_type](https://en.cppreference.com/w/cpp/types/underlying_type). * `using namespace magic_enum::ostream_operators;` ostream operators for enums. * `using namespace magic_enum::bitwise_operators;` bitwise operators for enums. diff --git a/example/example.cpp b/example/example.cpp index 3f5a72e..2294a58 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -96,13 +96,6 @@ int main() { static_assert(magic_enum::is_scoped_enum_v); static_assert(magic_enum::is_scoped_enum_v); - // 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); - static_assert(magic_enum::is_fixed_enum_v); - static_assert(magic_enum::is_fixed_enum_v); -#endif - // Enum pair (value enum, string enum name) sequence. constexpr auto color_entries = magic_enum::enum_entries(); std::cout << "Colors entries:"; diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 5907f98..5087e3e 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -314,12 +314,6 @@ struct is_unscoped_enum : std::false_type {}; template struct is_unscoped_enum : std::bool_constant>> {}; -template -struct is_fixed_enum : std::false_type {}; - -template -struct is_fixed_enum : std::is_enum {}; - template > struct underlying_type {}; @@ -347,14 +341,6 @@ struct is_scoped_enum : detail::is_scoped_enum {}; template inline constexpr bool is_scoped_enum_v = is_scoped_enum::value; -// Checks whether T is an Fixed enumeration type. -// Provides the member constant value which is equal to true, if T is an [Fixed enumeration](https://en.cppreference.com/w/cpp/language/enum) type. Otherwise, value is equal to false. -template -struct is_fixed_enum : detail::is_fixed_enum {}; - -template -inline constexpr bool is_fixed_enum_v = is_fixed_enum::value; - // If T is a complete enumeration type, provides a member typedef type that names the underlying type of T. // Otherwise, if T is not an enumeration type, there is no member type. Otherwise (T is an incomplete enumeration type), the program is ill-formed. template @@ -375,7 +361,6 @@ struct enum_traits>> { inline static constexpr bool is_unscoped_enum = is_unscoped_enum_v; inline static constexpr bool is_scoped_enum = is_scoped_enum_v; - inline static constexpr bool is_fixed_enum = is_fixed_enum_v; inline static constexpr std::size_t count = detail::count_v; inline static constexpr std::array values = detail::values(detail::range_v); diff --git a/test/test.cpp b/test/test.cpp index ad90205..1b8631b 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -453,13 +453,6 @@ TEST_CASE("type_traits") { REQUIRE(is_scoped_enum_v); REQUIRE_FALSE(is_scoped_enum_v); REQUIRE_FALSE(is_scoped_enum_v); - -#if defined(_MSC_VER) && _MSC_VER != 1923 // MSVC bug, we can not check is enum fixed - REQUIRE(is_fixed_enum_v); - REQUIRE(is_fixed_enum_v); - REQUIRE_FALSE(is_fixed_enum_v); - REQUIRE(is_fixed_enum_v); -#endif } TEST_CASE("enum_traits") {