Pooyan Dadvand wrote:
> Hi,
>
> First of all thank you for your kind suggestion. I completely agree
> about suggested methodology for optimizing. (Indeed this is the
> methodology I use in my work) However here my concern is the
> performance in normal use of container and not in seriliaztion and
> optimizing the serialization will be a secondary objective.   
>
> What I need to know is how to call a MyCostumSerialize method of my
> derive object with an additional parameter via a pointer to the base
> class: 
>
>
> Class VariableData{
>     std::size_t m_Key;
> public:
>
>     template<class TArchiveType>
>     MyCostumSerialize(TArchiveType &rArchive, const unsigned int
> Version, void* pValue) {}
>
> };
>
> template<class TDataType>
> class Veriable : public VariableData {
> public:
>
>     template<class TArchiveType>
>     MyCostumSerialize(TArchiveType &rArchive, const unsigned int
> Version, void* pValue)
>     {
>         rArchive & static_cast<TDataType * >(pVAlue);
>     }
>
> }
>
>
> Let say I don't how to call the MyCostumSerialize method of
> "Variable" class above when I have a "VariableData*" pointer in my
> container: 
>
>
> std::vector<std::pair<const VariableData*, void*> >
>
>
Just rename MyCostumeSerialize to serialize
 
Robert Ramey