Skip to content

add rfl::NamedTuple::apply() for convenient compile-time iteration #59

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

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

grandseiken
Copy link
Contributor

@grandseiken grandseiken commented Feb 7, 2024

Adds rfl::NamedTuple::apply() as proposed in #58.

I made one small design deviation from @liuzicheng1987's proposal which was to implement rfl::Field::name() by way of its rfl::internal::StringLiteral name, rather than via rfl::Literal, so that it can be a compile-time constant. I think that's important, e.g. the simple test I added wouldn't be possible without it.

clang on linux doesn't believe field.name() can be constexpr, so
fall back to Field::name() when constexpr is required.
@liuzicheng1987
Copy link
Contributor

I think the compile-time name is a great idea!

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.

2 participants