
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