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@lists.boost.org> 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@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users