From 37f2f3da6c30c52fc19927c989de37831ae30aba Mon Sep 17 00:00:00 2001 From: Terik23 Date: Sat, 17 Mar 2018 08:12:08 +0500 Subject: [PATCH] --- nameof.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nameof.cpp b/nameof.cpp index 06380da..71373cd 100644 --- a/nameof.cpp +++ b/nameof.cpp @@ -29,7 +29,8 @@ template const char* template_nameof_variable(const T& validate_typ template const char* template_nameof_type(const char* name) { return name; } ///Used to obtain the string name of a function. -#define nameof_function(name) template_nameof_function(#name, sizeof(#name)/sizeof(char) - 1); (name); + +#define nameof_function(name) template_nameof_function(#name); if (false) { (name) }; const char* template_nameof_function(const char* name) { return name; } //example