In my serialize function I am exporting a class which is a template wrapper around std:vector.
template <typename E>
class MyArray
{
public:
vector<E> array;
...
template <typename Archive>
void MyArray::serialize(Archive & ar, const unsigned int version)
{
ar & BOOST_SERIALIZATION_NVP(array);
}
}
When I add unique class instance variables to this array and then serialize it to XML...
...
MyArray<Color> colorsArray;
Color a;
a.name = "one";
colorsArray.add(a);
Color b;
colorsArray.add(b);
...
template <typename Archive>
void MyColorsObject::serialize(
Archive & ar, const unsigned int version)
{
ar & BOOST_SERIALIZATION_NVP(colorsArray);
}
Sometimes
the XML comes out using object_id_reference instead of the unique
values, and this then gets improperly unserialized with incorrect
values, i.e. both colors will have "one" as the name.