You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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 forrfl
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 valueFor example,
rfl::Attribute
andrfl::Rename
both haveget()
,operator()()
andvalue()
; butrfl::Validator
only hasvalue()
andrfl::Timestamp
has none of those and usestm()
instead.rfl::Box
usesptr()
.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?
The text was updated successfully, but these errors were encountered: