
27 Oct
2012
27 Oct
'12
7:51 p.m.
AMDG 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