From 18cfc68c65acef6fac839b25c9f252638dfce456 Mon Sep 17 00:00:00 2001 From: neargye Date: Wed, 27 May 2020 16:22:29 +0500 Subject: [PATCH] more consistent --- include/nameof.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/nameof.hpp b/include/nameof.hpp index 744829f..bee0337 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -278,7 +278,7 @@ template using remove_cvref_t = std::remove_cv_t>; template -using enable_if_enum_t = std::enable_if_t>, R>; +using enable_if_enum_t = std::enable_if_t>, R>; template inline constexpr bool is_enum_v = std::is_enum_v && std::is_same_v>; @@ -546,7 +546,7 @@ inline constexpr bool is_nameof_enum_supported = detail::nameof_enum_supported [[nodiscard]] constexpr auto nameof_enum(E value) noexcept -> detail::enable_if_enum_t { - using D = detail::remove_cvref_t; + using D = std::decay_t; using U = std::underlying_type_t; static_assert(detail::nameof_enum_supported::value, "nameof::nameof_enum unsupported compiler (https://github.com/Neargye/nameof#compiler-compatibility)."); static_assert(detail::count_v > 0, "nameof::nameof_enum requires enum implementation and valid max and min."); @@ -569,7 +569,7 @@ template // This version is much lighter on the compile times and is not restricted to the enum_range limitation. template [[nodiscard]] constexpr auto nameof_enum() noexcept -> detail::enable_if_enum_t { - using E = detail::remove_cvref_t; + using E = std::decay_t; constexpr std::string_view name = detail::enum_name_v; static_assert(name.size() > 0, "Enum value does not have a name.");