[serialization] how to serialize map of non-default-constructible?
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
Note that of of the tests shows private constructor - take a look at that. Robert Ramey ivo.t@moss-soft.de 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
participants (3)
-
er
-
ivo.t@moss-soft.de
-
Robert Ramey