If, as you describe, the values are in a database, why not write a code generator that reads this table and creates a .h and .cpp file with both the enum and a to_enum(int) function?
Advantages:
- Easy to add a
to_string(my_enum) function.
- Little maintenance required
- Database and code are in synch