Robert Ramey wrote:
> Oh, that should be easy:

> D1 *d1p;

> ar << d1;
> ar >> *d1p;

> Robert Ramey


Hi,

At
>     ar << d1;
>     ar >> bp; // but "bp" points already to an object of type D1

I meant : "bp" is "Base* bp"
So, if I call ar >> *bp; the Base::load will be called, not the derived D1:load.


Actually more precisely, I intend to do so

lass Base {
...
virtual ..
}
class D1 : public Base {
}


Base* bp1 = new D1(..some thing..);
Base* bp2 = new D1(..some thing else..);
ar << *bp1;
ar >> *bp2;

This means for all my serializable classes I have a kind of "=" operator defined.

regards,
Andrei


Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! Try it!