-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
Hi, thanks for this very interesting project!
Would it be possible to define a custom string for each enum value, instead of auto-generating it from the token? For example, instead of:
WISE_ENUM(Color, (GREEN, 2), RED)You could write:
WISE_CUSTOM_ENUM(Color, (GREEN, "vert", 2), (RED, "rouge"))(there's probably a better name than CUSTOM)
The main advantage for my use case: Let's say you use (GREEN, "GREEN") and the string is persistently stored in configuration files / XML / JSON etc. Later you rename the GREEN enum value in a refactor. This way it remains compatible with the old files because the string "GREEN" is independent. If you want, you can keep the old string, or decide to write custom code for backwards compatibility. But the compatibility doesn't break without notice.
andoks, Krzmbrzl, whyman and apmanol
Metadata
Metadata
Assignees
Labels
No labels