[odb-users] std::variant of raw pointers
Boris Kolpackov
boris at codesynthesis.com
Wed Oct 30 06:51:15 EDT 2024
MM <finjulhich at gmail.com> writes:
> Is there support for loading/persisting members that are
> std::variant<PTR1*, PTR2*, .. PTRn*> ?
> By using a virtual member like std::string, assuming each of those objects
> has a string has id, is there a way to cause the persistence or loading ?
No, the closest we have to something like this is support for
Polymorphism Inheritance:
https://www.codesynthesis.com/products/odb/doc/manual.xhtml#8.2
That's is, you would nee to replace std::variant<...> with PTRBASE*
with PRT1, PTR2, etc., all deriving (polymorphically) from PTRBASE.
More information about the odb-users
mailing list