Skip to content

Commit

Permalink
fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
Neargye committed Dec 9, 2023
1 parent c33d583 commit 6c20f9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/magic_enum/magic_enum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ struct is_valid_enum
#if defined(MAGIC_ENUM_NO_CHECK_VALID_ENUM_TYPE)
: std::true_type {};
#else
: std::bool_constant<std::is_enum_v<E> & (count_v<E, S> > 0)> {};
: std::bool_constant<std::is_enum_v<E> && (count_v<E, S> > 0)> {};
#endif

template <typename E, enum_subtype S>
Expand Down Expand Up @@ -1281,8 +1281,8 @@ template <detail::enum_subtype S, typename E>
template <auto V, detail::enum_subtype S = detail::subtype_v<std::decay_t<decltype(V)>>>
[[nodiscard]] constexpr auto enum_index() noexcept -> detail::enable_if_t<decltype(V), std::size_t> {\
using D = std::decay_t<decltype(V)>;
constexpr auto index = enum_index<D, S>(V);
static_assert(detail::is_valid_enum_v<D, S>, "magic_enum requires enum implementation and valid max and min.");
constexpr auto index = enum_index<D, S>(V);
static_assert(index, "magic_enum::enum_index enum value does not have a index.");

return *index;
Expand Down

0 comments on commit 6c20f9e

Please sign in to comment.