C++ Macro to create a string array

Viewed 6648

Is there a way to create a std::string (or char*) array with a pre-processor macro?

Something like this:

std::string myStrings[] = {MAGIC_MACRO(a, b, c)};

Result:

std::string myStrings[] = {"a", "b", "c"}

I know it looks pointless but I need it in a more complicated macro that has a variable number of arguments

4 Answers
Related