From e3c0e2a92250a343d3304ccb8831b0bc0cdc26ea Mon Sep 17 00:00:00 2001 From: Neargye Date: Mon, 3 Sep 2018 17:42:30 +0500 Subject: [PATCH] fix nameof enum --- include/nameof.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/nameof.hpp b/include/nameof.hpp index 39ed1ed..25c8119 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -459,8 +459,7 @@ constexpr cstring Nameof(const char* name, std::size_t size, bool with_suffix = } template ::value && - std::is_enum::value>::type> + typename = typename std::enable_if::value>::type> NAMEOF_CONSTEXPR cstring NameofEnum(T value) { #if defined(__clang__) || defined(_MSC_VER) return detail::NameofPretty( @@ -498,7 +497,7 @@ constexpr cstring NameofRaw(const char* name, std::size_t size) { #define NAMEOF_RAW(...) ::nameof::NameofRaw(#__VA_ARGS__, (sizeof(#__VA_ARGS__) / sizeof(char)) - 1) // Used to obtain the simple (unqualified) string name of a enum variable. -#define NAMEOF_ENUM(...) ::nameof::NameofEnum(__VA_ARGS__) +#define NAMEOF_ENUM(...) ::nameof::NameofEnum::type>(__VA_ARGS__) // Used to obtain the string name of a type. #define NAMEOF_TYPE(...) ::nameof::NameofType()