Using Boost 1.34.1 with VC++ 7.1 SP1
I have existing code which serializes/de-serializes correctly to boost::archive::xml_oarchive
Within the same .cpp file I'm trying to serialize instances of the same hierarchy to boost::archive::binary_oarchive using this code:
// ultimate sink for serialized data
std::ostringstream os;
// binary format is OK as it is going onto the clipboard
boost::archive::binary_oarchive oa(os);
// temp storage
std::vector vec;
// only serialize selected items
for (std::vector::iterator it = m_entities.begin();
it != m_entities.end();
++it)
{
if ((*it)->IsSelected())
vec.push_back((*it));
}
// just serialize the selected item vector (*)
oa & BOOST_SERIALIZATION_NVP(vec);
* - This is failing in oserializer.hpp line 417, the relevant code being:
// sice true_type is valid, and this only gets made if the
// pointer oserializer object has been created, this should never
// fail
bpos_ptr = archive_pointer_oserializer<Archive>::find(* true_type);
assert(NULL != bpos_ptr); // <------------------ this assert triggered.
I note the confident comment above find(). Can anyone help here?
Many thanks
Jerry