Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-06-27 10:13:51

Peter Dimov wrote:

>>> I think that the default behavior on a sequence of two saves with
>>> the same address should be to write the two objects, as if address
>>> tracking isn't on. If later a pointer to that address is saved, an
>>> exception should occur. Or more generally,
>>> - one value save, then N pointer saves sharing the same address
>>> should be
>>> OK;
>>> - M pointer saves sharing the same address should be OK; (*)
>>> - K value saves sharing the same address should be OK and result in
>>> K copies in the archive;
>> Currently you'll only get one copy for this case unless you suppress
>> tracking.
>>> - all other sequences raise an exception at first opportunity.
>>> Is there any reasonable use case which is prohibited by the above
>>> rules?
>>> (*) This promotes questionable coding practices but is consistent
>>> with the current behavior. :-)
>> Accept as noted above, that's how it works now.

> If you change the default behavior to handle these cases, while still
> allowing previous uses to work as they did, you will no longer need
> to trap anything. Which is why I proposed one possible default
> behavior that seems
> to fit that description, and asked you whether it sounds reasonable.

Actually I realize now that I mis-spoke. Default tracking behavior is
"track selectively". That means that a value saves are tracked only if a
object of the same type is anywhere serialized through a pointer. I believe
that the current behavior matches your preference as described above.

Robert Ramey

Boost list run by bdawes at, gregod at, cpdaniel at, john at