This commit is contained in:
Terik23 2016-10-05 14:14:37 +05:00 committed by GitHub
commit 9e76ea3771

13
nameofcpp Normal file
View file

@ -0,0 +1,13 @@
///Used to obtain the string name of a variable.
#define nameof(name) template_nameof((name), #name)
template <typename T>
const char* template_nameof(T test, const char* name)
{
return name;
}
// int test = 0;
// std::cout << nameof(test) << std::endl;
// prints "test”