Refer to https://stackoverflow.com/a/5094430/391104
//typedef enum {Unknown = -1 Linux=7, Apple=2, Windows=100} OS_type;
DEFINE_ENUM_WITH_STRING_CONVERSIONS(OS_type, (Linux)(Apple)(Windows))
int main()
{
OS_type t = Windows;
std::cout << ToString(t) << " " << ToString(Apple) << std::endl;
}
The problems I have are:
1> the OS_type is defined in the library and I don't have permission to change it.
2> In addition, the value of the enum is customized!
What should I do?