Sohail Somani wrote:
Thanks for your suggestion. It seems the class_id's are reversed and that tracking_level=0! Is that a clue? Wieeeeeerd!
XML output:
From gcc 3.2:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization>
<b class_id="0" tracking_level="0" version="1"> <px class_id="2" class_name="derived" tracking_level="1" version="0" object_id="_0"> <base class_id="1" tracking_level="1" version="0" object_id="_1"></base> derived id </px> </b>From Visual C++ 7.1:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization>
<b class_id="0" tracking_level="0" version="1"> <px class_id="1" class_name="derived" tracking_level="1" version="0" object_id="_0"> <base class_id="2" tracking_level="0" version="0"></base> derived id </px> </b>
shared_ptr addresses are not tracked since one isn't serializing a pointer to a shared_ptr. So this is OK. What I see is that on the gcc output, we're "skipping" a class id. This is not what I expect to see. I looked into the code basic_oarchive.cpp where classes are tracked. I suspect this would be tracked down to something in the extended_type_info registry which isn't properly keeping track. Basically one would have to dive in with the debugger with your test. Robert Ramey