Boost logo

Boost :

Subject: Re: [boost] [Variant] Documentation Questions/Notes
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-10-27 15:51:22


On 10/27/2012 10:50 AM, Dave Abrahams wrote:
> <snip>
> - The "temporary heap backup" technique seems to have a hole:
> 1. Copy-construct the content of the left-hand side to the heap;
> call the pointer to this data backup.
> 2. Destroy the content of the left-hand side.
> 3. Copy-construct the content of the right-hand side in the
> (now-empty) storage of the left-hand side.
> 4. In the event of failure, copy backup to the left-hand side
> storage.
> 5. In the event of success, deallocate the data pointed to by
> backup.
> What happens in the event of a failure in step 4?

backup is a pointer. Copying it can't fail.

> <snip>

In Christ,
Steven Watanabe

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