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

Improve reflection tagging #22

Merged
merged 3 commits into from
Jul 10, 2024
Merged

Improve reflection tagging #22

merged 3 commits into from
Jul 10, 2024

Conversation

mcy
Copy link
Owner

@mcy mcy commented Jul 10, 2024

This change updates the BestReflect() tagging API to not require the tap operator (->*) or calls to best::vals<> to manually hoist arguments into the type system.

Instead, we observe that all of the requisite information for building a type descriptor with tags is already present at constexpr time, and therefore can all be hoisted into a template <const auto&>. If we add an extra reification step, we can record field keys (e.g. ptrs-to-member) as data members in the mirror object returned by BestReflect(), put the mirror object into a constexpr variable, then pass that to the function that constructs the complete type descriptor as a non-type template argument.

Additionally, this change adds:

  • best::abridge<T>, a symbol abridgement helper.
  • best::mirror::with(tags), for adding tags directly to the reflected type, not one of its fields.

@mcy mcy merged commit a3dcfe7 into main Jul 10, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant