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

Feature: mph integration for finding struct fields #65

Open
IndianBoy42 opened this issue Dec 16, 2024 · 0 comments
Open

Feature: mph integration for finding struct fields #65

IndianBoy42 opened this issue Dec 16, 2024 · 0 comments

Comments

@IndianBoy42
Copy link

It would be nice to have a function with a signature like:

auto reflect::find<T>(std::string_view field_name)

returning the same thing we get in reflect::for_each and using a perfect hash to find the field (right now I just loop through all fields to find it)

The other possibility is something like reflect::enumerators but reflect::fields<I> which returns a lookup table between the field names and the field index which can be passed to reflect::get, reflect::member_name, reflect::type_name, etc. Which can be passed to a perfect hash library

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

1 participant