Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-05 05:17:55


Li Lirong <lirong_at_[hidden]> writes:

> Robert Ramey wrote:
>
>> Dave Abrahams
>
>>>What's the point of doing that when you could just keep the
>>>un-serialized objects in your undo stack?
>> Indeed. I responded to the original question about how to
>> do it without considering why one would want to. I would
>> like to hear from the original poster as to what his
>> motivation is.
>>
>
> There are two reasons.
>
> First, the object is referenced elsewhere in the programme. It is not
> safe to simply replace the pointer with another object.

I suspect that you'll find you face the same problem when
de-serializing the object for undo. Give it some careful thought, and
especially consider the advantages of a no-throw undo mechanism when
it comes to rolling back partially-complete operations that fail.

> Second, the object itself keeps some pointers to other objects.

I don't see why that matters.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk