|
Boost Users : |
Subject: Re: [Boost-users] BoostSerialization callinga customserialize method
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-08-25 15:39:14
Pooyan Dadvand wrote:
> The question is not the name of the method, the problem is the
> additional parameter which boost::serialization cannot pass to me.
> For this reason I have to call my own serialize method inside the
> standard serialize method prepared for boost::serialization.
>
> template<class TArchiveType>
> MyContainer::serialize(TArchiveType &rArchive, const unsigned int
> Version)
> {
> p_variable_data->MyCustomSerialize(rArchive, Version, MyData);
> }
>
try the following:
template<class TArchiveType>
MyContainer::serialize(TArchiveType &rArchive, const unsigned int
Version)
{
rArchive << p_variable_data;
}
or
template<class TArchiveType>
MyContainer::serialize(TArchiveType &rArchive, const unsigned int
Version)
{
rArchive << std::pair<?, ?>(p_variable_data, MyData);
}
I'm sure that there is an easy way to use the library to get the effect you
want.
But it will require effort to see it.
Robert Ramey
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