
John Reid ha escrito:
Hi,
I had some problems serializing/deserializing a multi_index container. I've tried a work around of copying the container into a vector and serializing/deserializing this (which works). Does anyone know the conditions under which serialization of multi_index containers do not work? My guess is my operator< may not satisfy the requirements although it has stood up to all the testing I have been able to do so far.
I am using VS2005 with boost 1_33_1.
FYI I'm getting an archive exception from this code in ordered_index.hpp: void rearranger(node_type* position,node_type *x) {
[...]
}
Hello John, from your description looks like loading is failing because your operator< is not *serialization-compatible*, as required in http://www.boost.org/libs/multi_index/doc/reference/ord_indices.html#seriali... Serialization-compatibility formal definition is given at: http://boost.org/libs/multi_index/doc/reference/multi_index_container.html#s... What this means is, if you've got elements a,b and its corresponding deserialized equivalents a',b', then a