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

"Standardize" interface for getting the underlying data in rfl:: wrapper-types #192

Open
GregTheMadMonk opened this issue Sep 17, 2024 · 0 comments

Comments

@GregTheMadMonk
Copy link
Contributor

Greetings!

Trying to integrate reflect-cpp in a project that already uses a different library with custom traits to bind fields to SQL requests (SOCI) and I find myself wondering how to better approach making them work together. The problem comes from types like std::optional<rfl::Timestamp<...>> and such, where it's not exactly viable to just replace the field in the binding with a .get() or .value() call on it. I want to define a generic trait for rfl wrapper types (and my custom wrappers that will conform to it too), but there appears to be no uniform interface among them to access the underlying value

For example, rfl::Attribute and rfl::Rename both have get(), operator()() and value(); but rfl::Validator only has value() and rfl::Timestamp has none of those and uses tm() instead. rfl::Box uses ptr().

Could there maybe be a single function/method/trait that would help us get the underlying value of a wrapper to avoid manually specializing integration traits for all the specific cases?

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