From 53e7ce7e7fc5d4b9fed1380ae37deca4400d6316 Mon Sep 17 00:00:00 2001 From: Terik23 Date: Sat, 17 Mar 2018 08:12:52 +0500 Subject: [PATCH] --- nameof.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nameof.cpp b/nameof.cpp index 71373cd..b0550d1 100644 --- a/nameof.cpp +++ b/nameof.cpp @@ -22,16 +22,16 @@ ///Used to obtain the string name of a variable. #define nameof_variable(name) template_nameof_variable(name, #name) -template const char* template_nameof_variable(const T& validate_type, const char* name) { return name; } +template constexpr const char* template_nameof_variable(const T& validate_type, const char* name) { return name; } ///Used to obtain the string name of a type. #define nameof_type(name) template_nameof_type(#name) -template const char* template_nameof_type(const char* name) { return name; } +template constexpr 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); if (false) { (name) }; -const char* template_nameof_function(const char* name) { return name; } +constexpr const char* template_nameof_function(const char* name) { return name; } //example int test = 0;