Boost logo

Boost Users :

From: Terence Wilson (tez_at_[hidden])
Date: 2005-12-24 16:41:30


> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Robert Ramey
> Sent: Saturday, December 24, 2005 9:58 AM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] Boost serialization- looks great,but I'm
> confused about serializing polymorphic types
>
> Terence Wilson wrote:
> > I am an MFC veteran that wants to use a more modern mechanism for
> > archival, in MFC a base pointer can be written and the object
> > recreated automatically upon the read.
>
> The boost serialization library was very much inspired by the MFC version
> so I would expect that it should come naturally to you.
>

Sure, the underlying principles may be the same but I'm caught up in the
boilerplate required to make it work. To be honest, I found the
documentation difficult to assimilate because it reads like a technical
discussion of the implementation details rather than a recipe book. This
isn't intended as a criticism, obviously people learn in different ways, but
speaking from a personal standpoint, it would really help if you had code
samples for the top 5 use cases of the library. One people have working code
the pressure comes off and they are more willing to learn about the nuances.

> > I've been reading the
> > serialization documentation and I am very confused about what I need
> > to do to make this work using Boost, the code I have so far fails to
> > compile with a static assert in the save function in oserializer.hpp.
>
> <snip>
>
> > void save_myclass(CMyClassBase* pMyClassBase, const char * filename){
>
> try changing the above to:
>
> void save_myclass(CMyClassBase const * const pMyClassBase, const char *
> filename){
>
> And read the rationale section on why this works (assuming it does)
>

Thanks. It did work, but the assertion led me in completely the wrong
direction.

I appreciate you getting back to me during the holiday period. Merry
Christmas to you and yours.

> Robert Ramey
>
>
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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