diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 0e4a195..9359c3e 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -51,7 +51,7 @@ // Checks magic_enum compiler compatibility. #if defined(__clang__) || defined(__GNUC__) && __GNUC__ >= 9 || defined(_MSC_VER) -# undef MAGIC_ENUM_SUPPORTED +# undef MAGIC_ENUM_SUPPORTED # define MAGIC_ENUM_SUPPORTED 1 #endif @@ -180,7 +180,6 @@ constexpr auto n() noexcept { # endif return static_string{name}; #else - static_assert(supported::value, "magic_enum: Unsupported compiler (https://github.com/Neargye/magic_enum#compiler-compatibility)."); return std::string_view{}; // Unsupported compiler. #endif } @@ -199,7 +198,6 @@ constexpr auto n() noexcept { # endif return static_string{name}; #else - static_assert(supported::value, "magic_enum: Unsupported compiler (https://github.com/Neargye/magic_enum#compiler-compatibility)."); return std::string_view{}; // Unsupported compiler. #endif } @@ -337,11 +335,11 @@ struct underlying_type {}; template struct underlying_type : std::underlying_type> {}; -template +template > struct enum_traits {}; template -struct enum_traits>> { +struct enum_traits { using type = E; using underlying_type = typename detail::underlying_type::type; @@ -393,7 +391,8 @@ struct enum_traits>> { private: static_assert(is_enum_v, "magic_enum::enum_traits requires enum type."); - static_assert(count > 0, "magic_enum::enum_range requires enum implementation or valid max and min."); + static_assert(supported::value, "magic_enum unsupported compiler (https://github.com/Neargye/magic_enum#compiler-compatibility)."); + static_assert(count > 0, "magic_enum::enum_range requires enum implementation and valid max and min."); using U = underlying_type; inline static constexpr auto indexes = detail::indexes(std::make_integer_sequence>{}); };