Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this library support reflecting Enum class member to string? #103

Open
eesaber opened this issue Apr 8, 2023 · 2 comments
Open

Does this library support reflecting Enum class member to string? #103

eesaber opened this issue Apr 8, 2023 · 2 comments

Comments

@eesaber
Copy link

eesaber commented Apr 8, 2023

Does this library support reflecting Enum class member to string?

For example, I have a enum class Foo

enum class Foo {
  kBar,
  kBaz,
};

And I want to convert to string

"kBar", "kBaz"
@TheNitesWhoSay
Copy link
Owner

TheNitesWhoSay commented Apr 8, 2023

No, enum to string is not supported by RareCpp, at least in the short term I've decided I can't do this better than existing libraries (full-support for typical enum reflection activities is a very non-trivial problem) depending on your needs I recommend one of:

@eesaber
Copy link
Author

eesaber commented Apr 15, 2023

I am currently working on a side project in ORM (Object-Relational Mapping). One of my requirements is to be able to map database enum types to C++ enum types, and vice versa.

Thanks a lot for the suggestion of using the magic_enum library. I will take a look at it and see if it fits my needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants