Re:Show HN: Nameof Operator for Modern C++
by asveikau on Sunday March 24, 2019 @05:03PM
(#19478765)
That was what I was thinking, then I saw that this will stringify enum values, eg. nameof(c) returns "RED", which the preprocessor #x will not do.
[ Parent
| on HN ]
To be sure:
nameof(c) returns "c" (nameof return name of variable)
nameof_enum(c) returns "RED" (nameof_enum return enum name of enum variable)