Subject: Re: [boost] [multi_index][serialization] save_construct_data not called for multi_index collection
Date: 2009-12-21 11:14:47
Felipe Magno de Almeida escribió:
> Boost.Serialization has support for non-default classes using
> save_construct_data and load_construct_data overloads.
> These are called before serialization to save and load information
> that's important for the construction of the object.
> Unfortunately, multi_index doesn't call these functions when
> serializing, so serialization of non-default-constructible classes is
> impossible with multi_index.
Hi, seems you spotted a bug here. load_construct_data_adl is actually used
(see boost/multi_index/detail/archive_constructed.hpp ), but this is not
for save_construct_data_adl, which is also necessary.
I'll fix this. I'd appreciate if you can file a ticket in the Trac
you can try your hand patching boost/multi_index_container.hpp: lines
(in 1.41, some offset might occur in 1.38) look like
save_construct_data_adl should be called before "ar<<..." with *it. Please
report back about your success or lack of it.
Thank you for using Boost.MultiIndex.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo