From 885b202dc625e4184ce63238e506fa0d5428e62f Mon Sep 17 00:00:00 2001 From: neargye Date: Mon, 19 Aug 2019 21:53:06 +0500 Subject: [PATCH] remove optional auto --- include/magic_enum.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;