From f4004193452556d03aa0043549c95eb50683c264 Mon Sep 17 00:00:00 2001 From: Neargye Date: Sat, 12 May 2018 01:33:27 +0500 Subject: [PATCH] remove unused parameter --- include/nameof.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/nameof.hpp b/include/nameof.hpp index 63ac291..3caac1f 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -43,22 +43,22 @@ inline constexpr bool IsLexeme(const char s) noexcept { } // namespace detail -inline constexpr const char* Nameof(const char* name, const ::std::size_t length, const ::std::size_t) noexcept { +inline constexpr const char* Nameof(const char* name, const ::std::size_t length) noexcept { return length == 0 ? name : detail::IsLexeme(name[length - 1]) ? &name[length] - : Nameof(name, length - 1, 0); + : Nameof(name, length - 1); } } // namespace nameof #if defined(__GNUC__) || defined(__clang__) // Used to obtain the string name of a variable, type, function, macros and etc. -# define NAMEOF(name) ::nameof::Nameof(#name, sizeof(#name) / sizeof(char) - 1, sizeof(void(*)(__typeof__(name)))) +# define NAMEOF(name) ::nameof::Nameof(#name, sizeof(#name) / sizeof(char) - 1 + (0 * sizeof(void(*)(__typeof__(name))))) // Used to obtain the string full name of a variable, type, function, macros and etc. -# define NAMEOF_FULL(name) ::nameof::Nameof(#name, 0, sizeof(void(*)(__typeof__(name)))) +# define NAMEOF_FULL(name) ::nameof::Nameof(#name, (0 * sizeof(void(*)(__typeof__(name))))) #elif defined(_MSC_VER) // Used to obtain the string name of a variable, type, function, macros and etc. -# define NAMEOF(name) ::nameof::Nameof(#name, sizeof(#name) / sizeof(char) - 1, sizeof(typeid(name))) +# define NAMEOF(name) ::nameof::Nameof(#name, sizeof(#name) / sizeof(char) - 1 + (0 * sizeof(typeid(name)))) // Used to obtain the string full name of a variable, type, function, macros and etc. -# define NAMEOF_FULL(name) ::nameof::Nameof(#name, 0, sizeof(typeid(name))) +# define NAMEOF_FULL(name) ::nameof::Nameof(#name, (0 * sizeof(typeid(name)))) #endif