From 0e5a8df9067ae7d8397a77b7ef3114f29622ac3a Mon Sep 17 00:00:00 2001 From: schaumb Date: Fri, 23 Jun 2023 12:08:29 +0200 Subject: [PATCH] fix member functions --- include/nameof.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/nameof.hpp b/include/nameof.hpp index 70f8c35..4f7976a 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -968,7 +968,8 @@ constexpr auto n() noexcept { #if defined(__clang__) || defined(__GNUC__) constexpr auto name = pretty_name({__PRETTY_FUNCTION__, sizeof(__PRETTY_FUNCTION__) - 2}); #elif defined(_MSC_VER) && defined(_MSVC_LANG) && _MSVC_LANG >= 202002L - constexpr auto name = pretty_name({__FUNCSIG__, sizeof(__FUNCSIG__) - 16}); + constexpr auto name = pretty_name({__FUNCSIG__, + sizeof(__FUNCSIG__) - 18 + std::is_member_function_pointer_v}); #else constexpr auto name = string_view{}; #endif