1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00

add missing static_assert

This commit is contained in:
neargye 2020-06-06 14:01:17 +05:00
parent 963ee65e95
commit 97e6f35c46

View file

@ -222,6 +222,8 @@ inline constexpr auto name_v = n<E, V>();
template <typename E, auto V>
constexpr bool is_valid() noexcept {
static_assert(is_enum_v<E>, "magic_enum::detail::is_valid requires enum type.");
return n<E, static_cast<E>(V)>().size() != 0;
}