Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-12-24 12:57:54


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.

> 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)

Robert Ramey


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