Since sometime now I am thinking how can it be made possible to convert an enum name as a string, given the enum value. This is especially useful if you use enums as error values and want to trace these out as strings.
The stringify() macro can be used to turn any text in your code into a string, but only the exact text between the parentheses. There are no variable dereferencing or macro substitutions or any other sort of thing done.
For example, you could say:
1 2 3 4
int main()
{
cout << stringify( Hello world! ) << endl; // (leading and trailing whitespace is ignored)
}
Instead of using an enum. Create another file called "Translations.h" or something. Inside each of them have something like
#define ERROR_IAMBUSY "I am busy"
This is a common technique that is used when writing multi-language software. You put all of the strings used in your program in this file (not just errors) so the translators only have to work on 1 file to translate your application :)