From 6291bc438ed59d1b9345343e01cc91843fbab772 Mon Sep 17 00:00:00 2001 From: Terik23 Date: Sat, 17 Mar 2018 08:30:45 +0500 Subject: [PATCH] --- nameof.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nameof.cpp b/nameof.cpp index d98ae60..8ba5815 100644 --- a/nameof.cpp +++ b/nameof.cpp @@ -27,6 +27,7 @@ inline constexpr const char* template_nameof_(const char* name, size_t length) { ? &name[length] : template_nameof_(name, length - 1); } + // Used to obtain the string name of a variable. #define nameof_variable(variable) template_nameof_variable(variable, #variable, sizeof(#variable) / sizeof(char) - 1) template @@ -40,6 +41,7 @@ template inline constexpr const char* template_nameof_type(const ch #define nameof_function(function) template_nameof_function(#function, sizeof(#function) / sizeof(char) - 1); if (false) (void)(function); inline constexpr const char* template_nameof_function(const char* name, size_t length) { return template_nameof_(name, length); } +// Example. #include struct SomeStruct {