[odb-users] Specializing wrapper_traits

Hales, Steve Steve.Hales at garmin.com
Wed Apr 27 11:43:21 EDT 2016


Hi Boris,

Thanks for your help. I believe we have this mostly working now. A follow-up question: What is the purpose of null_handler and null_default in wrapper_traits?

Thanks,
Steve




On 4/27/16, 1:26 AM, "Boris Kolpackov" <boris at codesynthesis.com> wrote:

>Hi Steve,
>
>Hales, Steve <Steve.Hales at garmin.com> writes:
>
>> My team has a template class similar to odb::nullable that we would like to
>> use to wrap nullable fields. I discovered the wrapper_traits class in
>> ODB. It looks like we might be able to provide another specialization of
>> wrapper_traits for our template class. Is that correct?
>
>Yes, that's what it's for.
>
>
>> If so, are there any examples available to provide guidance on how
>> to achieve this?
>
>The ODB Boost profile library (libodb-boost) has a specialization for
>boost::optional. It shows how to do this "properly", i.e., it is completely
>non-intrusive and can be enabled via the profile mechanism (pass
>--profile|-p boost/optional). You can also do it like this, or you can add
>the necessary prologue/epilogue options (see boost/optional.options) to the
>ODB command line, or you can simply add the wrapper_traits specialization
>into the same header as you nullable class template and then you won't need
>to pass anything to the ODB compiler.
>
>Boris

________________________________

CONFIDENTIALITY NOTICE: This email and any attachments are for the sole use of the intended recipient(s) and contain information that may be confidential and/or legally privileged. If you have received this email in error, please notify the sender by reply email and delete the message. Any disclosure, copying, distribution or use of this communication (including attachments) by someone other than the intended recipient is prohibited. Thank you.



More information about the odb-users mailing list