Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
asveikau
· 7y ago · 0 comments
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.
Comments
[–]
neargye
7y ago
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)
[–]
CalChris
7y ago
I only use STRINGIZE for error messages. I learned about it from reading the source for assert macros.