From d099f13d1294366ae295fee57f41cf85b764a1da Mon Sep 17 00:00:00 2001 From: neargye Date: Wed, 3 Jun 2020 20:04:09 +0500 Subject: [PATCH] clean-up --- include/nameof.hpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/include/nameof.hpp b/include/nameof.hpp index e347d9d..f637342 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -604,8 +604,9 @@ 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 = std::decay_t; - constexpr std::string_view name = detail::enum_name_v; + using D = std::decay_t; + static_assert(detail::nameof_enum_supported::value, "nameof::nameof_enum unsupported compiler (https://github.com/Neargye/nameof#compiler-compatibility)."); + constexpr std::string_view name = detail::enum_name_v; static_assert(name.size() > 0, "Enum value does not have a name."); return name; @@ -690,11 +691,7 @@ template #define NAMEOF_FULL_TYPE_EXPR(...) ::nameof::nameof_full_type() // Obtains string name of type using RTTI. -#if defined(NAMEOF_TYPE_RTTI_SUPPORTED) && NAMEOF_TYPE_RTTI_SUPPORTED -# define NAMEOF_TYPE_RTTI(...) ::nameof::detail::n(typeid(__VA_ARGS__).name()) -#else -# define NAMEOF_TYPE_RTTI(...) static_assert(sizeof(__VA_ARGS__) < 0, "NAMEOF_TYPE_RTTI unsupported compiler."); -#endif +#define NAMEOF_TYPE_RTTI(...) ::nameof::detail::n(typeid(__VA_ARGS__).name()) #if defined(_MSC_VER) # pragma warning(pop)