|
Boost : |
From: Darren Cook (darren_at_[hidden])
Date: 2005-04-22 20:46:20
Hi,
Can I suggest adding another example to:
http://www.boost.org/libs/serialization/doc/special.html#objecttracking
I had this code:
void mycallback(const BigClass &BC){
const SomeData *d=BC.get_data();
...
archive & BOOST_SERIALIZATION_NVP(d);
}
My archive was smaller than intended and I discovered that the data only
got saved the first time. XML version showed me it was using:
object_id_reference.
It turns out the fix was to dereference the pointer:
archive & BOOST_SERIALIZATION_NVP(*d);
That is an easy to write bug; I cannot see how the serialization library
can catch it, so all I can think of is to make people aware of it in the
docs. Also please mention "object_id_reference" in the objecttracking
section of the docs, as that was the first thing I googled on and it got
no useful hits.
Darren
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk