Hacker News new | ask | show | jobs
by mehrdadn 1417 days ago
To my knowledge magic_enum has some severe limitations; for example, it limits the range of enum values, it cannot handle duplicate enum values, it uses compiler-specific hackes, etc. There is a list of them outlined at [1]. Before writing this library I did take a look around for existing ones (there's also wise_enum [2] for example), but I couldn't find any that supports all of the functionality implemented here.

Update: And I'm glad to see interest! I just updated the repo to add a parse_enum function for converting strings to enums as well.

[1] https://github.com/Neargye/magic_enum/blob/master/doc/limita...

[2] https://github.com/quicknir/wise_enum