Boost logo

Boost Users :

Subject: Re: [Boost-users] BoostSerialization callinga customserialize method
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-08-27 14:50:03


Pooyan Dadvand wrote:

> But it's not what I'm asking. What I'm asking is a very special case
> in which the serialize don't have enough information to deal with my
> void* in std::pair<VariableData*, void*> and for this reason I need
> the help of VariableData derived class to give the serialization the
> necessary type information. Actually I get the following error using
> the normal serialization method as you suggest:
>
> /usr/local/include/boost/archive/detail/oserializer.hpp:465: error:
> 'void*' is not a pointer-to-object type

ahh - Ok

std::pair<VariableData*, void*> m_x
...
ar << m_x

of course won't work- my mistake - since there is no way
to determine what the true type is.

So how about one of the following?

struct extradata {
...
};

std::pair<VariableData, extradata> m_x
std::pair<VariableData &, extradata&> m_x
std::pair<VariableData *, extradata*> m_x
std::pair<VariableData*, extradata &> m_x
...
ar << m_x;

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