veselink1/refl-cpp

Is there a way to inspect enum cases?

eliemichel opened this issue · 2 comments

Sorry to ask questions, I'm just having hard time reading the code, and trial and error is tough with meta-programming... Is there a way to list as strings the enum cases? Basic application would be auto-generating debug function that displays an enum as human-readable text.

That is quite alright. The documentation is very lacking at the moment and I am looking into improving that in the future.

Reflecting enums is currently not supported by refl-cpp. The reason being that member_descriptors internally hold constexpr pointers to a field/function.

Have you considered something like magic_enum which uses a different type of trickery and does not require you to manually type out the names of fields?

Oh nice this magic_enum is what I'm looking for here :)