Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::serialization - Non intrusive serialization of user-defined members?
From: Robert Ramey (ramey_at_[hidden])
Date: 2018-03-05 16:52:39


On 3/5/18 8:36 AM, Lars Ruoff via Boost-users wrote:
> Maybe i didn't express it clearly enough.
> I want non-intrusive serialization.
> I want to modify neither ContqinerClass, nor MemberClass.
> (Both are just custom classes, no link with STL containers. I just
> wanted to express that Container contains an instance of Member)
>
> So how can i write
> ar & c.special_member;
> since there is no serialize member function for this class?

That's the problem. the type of c.special_member must be serializable.
If it's not already, you have to make it serializable by writing your
own serialize function for it. It can be either intrusive or
non-intrusive - doesn't matter. But it has to be there. The versioning
of type type of special_member is handled in the serialization of that type.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net