diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 852714d..1f2c117 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -300,7 +300,7 @@ template > // Returns integer value from enum value. template > -[[nodiscard]] constexpr auto enum_integer(E value) noexcept { +[[nodiscard]] constexpr std::underlying_type_t enum_integer(E value) noexcept { static_assert(detail::check_enum_v, "magic_enum::enum_integer requires enum type."); return static_cast>(value); @@ -309,7 +309,7 @@ template > // Returns enum value at specified index. // No bounds checking is performed: the behavior is undefined if index >= number of enum values. template> -[[nodiscard]] constexpr auto enum_value(std::size_t index) { +[[nodiscard]] constexpr D enum_value(std::size_t index) { static_assert(detail::check_enum_v, "magic_enum::enum_value requires enum type."); constexpr auto values = detail::values_v;