Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] how to serialize map ofnon-default-constructible?
From: Robert Ramey (ramey_at_[hidden])
Date: 2009-11-24 12:02:29


Note that of of the tests shows private constructor - take a look at that.

Robert Ramey

ivo.t_at_[hidden] wrote:
> Hi to everybody,
>
> I'm pretty new to the list, work for some time with Boost and C++ and
> have a fair knowledge but am not an expert yet. I try to serialize a
> map whose type is not default-constructible, and I'm seriously stuck
> there. I thought the load_construct_data and save_construct_data
> overrides would help me there, but that seems not to be the case. I
> tried to create a private default constructor hoping that the map
> (respectively pair) constructor could access it, due to the
> boost::serialization::access friend declaration, but that didn't work
> as well. I really do _not_ want to make a public default constructor.
> What could I do as a workaround??
>
> Any help would be greatly appreciated!!
>
> Btw, I work with Boost 1.39 and Visual Studio 2005.
>
> Thank you very much in advance
>
> Ivo


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