From e662d0031ebb8aa0cf861340191bcf43ced55bc7 Mon Sep 17 00:00:00 2001 From: schaumb Date: Fri, 23 Jun 2023 11:11:56 +0200 Subject: [PATCH] add template argument --- include/nameof.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nameof.hpp b/include/nameof.hpp index a231b73..1df8211 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -996,7 +996,7 @@ consteval auto get_member_name() noexcept { constexpr bool is_defined = sizeof(decltype(get_base_type(V))) != 0; static_assert(is_defined, "nameof::nameof_member member name can use only if the struct is already fully defined. Please use NAMEOF macro, or separate definition and declaration."); if constexpr (is_defined) { - return n(); + return n.*V)>(); } else { return ""; }