Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::serialization - Non intrusive serialization of user-defined members?
From: Lars Ruoff (lars.ruoff_at_[hidden])
Date: 2018-03-05 17:47:32


Ah, ok.
I assumed the syntax
  ar & c.special_member; //uses it's own version
only worked with the intrusive version (i.e. serialize as a member of
MemberClass).
Seems it still works with non-intrusive. Pure magic.
Thanks!

On Mon, Mar 5, 2018 at 6:31 PM, Robert Ramey via Boost-users <
boost-users_at_[hidden]> wrote:

> On 3/5/18 9:06 AM, Lars Ruoff via Boost-users wrote:
>
>> Sorry, still don't understand.
>> As said, i have defined
>> void serialize(Archive & ar, MemberClass & m, const unsigned int version);
>>
>> so
>> template<class Archive>
>> void serialize(Archive & ar, ContainerClass & c, const unsigned int
>> version)
>> {
>> ar & c.other_members; // easy - built-in type
>> serialize(ar, c.special_member, version); //use same version???
>> }
>> compiles.
>>
>
> where is
>
> template<class Archive>
> void serialize(Archive & ar, special_member_type & t, const unsigned int
> version){
> ar & ??;
> };
>
> ?
>
> If you have this you could write:
>
> template<class Archive>
> void serialize(Archive & ar, ContainerClass & c, const unsigned int
> version){
> ar & c.other_members; // easy - built-in type
> ar & c.special_member; //uses it's own version
> }
>
> Robert Ramey
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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