Boost logo

Boost Users :

From: Andrei Popa (andrei4popa_at_[hidden])
Date: 2008-03-26 13:01:26


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 D1I 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 solass 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!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us



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