OK - here are the changes I made in order for your example to work:
the main one is to enclose the output in {} to be sure that the xml archive dtor is called. Yes I forget that when I ported the example to std formats instead of my own
Robert Ramey
I just commented out some stuff that made no sense to me.
Robert Ramey
//triggers a load exception // what is this for? #if 0 std::string str = sstr.str(); boost::replace_all(str, "
", "
- the reset's are for clearing the object (not necessary) - with seekg(0) I hope that the loading starts reading at the begin of the stream (where the XML starts) - the replace stuff was a simulation of an actual case: the second shared pointer entry in the XML became corrupt, which triggered an excpetion. However the first shared pointer seems to be loaded complete already. Calling 'delete_created_pointers' on the archive freed this piece of memory also, so that an access violation is triggered when the object (and thus the shared pointer) went out of scope. Wkr, me