From 24837402cc9f6ff18942b211985c08c5b9a0c547 Mon Sep 17 00:00:00 2001 From: Neargye Date: Sun, 2 Sep 2018 00:14:11 +0500 Subject: [PATCH] clean-up --- include/nameof.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/nameof.hpp b/include/nameof.hpp index b5aed41..65fd63f 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -364,7 +364,7 @@ NAMEOF_CONSTEXPR int NameofEnumImpl1() { } template -NAMEOF_CONSTEXPR nameof::cstring NameofEnumImpl2() { +NAMEOF_CONSTEXPR cstring NameofEnumImpl2() { #if defined(__clang__) return {__PRETTY_FUNCTION__, sizeof(__PRETTY_FUNCTION__) - 1, @@ -387,7 +387,7 @@ NAMEOF_CONSTEXPR nameof::cstring NameofEnumImpl2() { template struct NameofEnumImpl { - NAMEOF_CONSTEXPR nameof::cstring operator()(int value) const { + NAMEOF_CONSTEXPR cstring operator()(int value) const { return (value - I == 0) ? NameofEnumImpl2() : (value - I == 1) @@ -410,7 +410,7 @@ struct NameofEnumImpl { template struct NameofEnumImpl { - NAMEOF_CONSTEXPR nameof::cstring operator()(int) const { return {}; } + NAMEOF_CONSTEXPR cstring operator()(int) const { return {}; } }; template @@ -451,20 +451,22 @@ 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 && + std::is_enum::value>::type> NAMEOF_CONSTEXPR cstring NameofEnum(T value) { #if defined(__clang__) || defined(_MSC_VER) return detail::NameofPretty(detail::NameofEnumImpl{}(static_cast(value)), false); #elif defined(__GNUC__) return detail::NameofEnumImpl{}(static_cast(value)); #else -return {}; + return {}; #endif } template NAMEOF_CONSTEXPR cstring NameofType() { - return true ? detail::NameofType>() : detail::NameofType>(); + return true ? detail::NameofType>() + : detail::NameofType>(); } template