My question is the inverse of this question.
I want to write a macro that will accept an integer and a string literal as it's arguments, like so:
#define STRING_MAP_ENTRY(value, name) \
{value, std::to_string(val) + " - " + name}
STRING_MAP_ENTRY(0, "ENTRY_1")
The macro should turn the above call into {0, "0 - ENTRY_1"}
Is there a way to do this? My current attempt is this:
#define STRING_MAP_ENTRY(val, name) \
{ val, std::to_string(val) + "(" + name + ")" }