Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-03-23 13:26:04


Gennaro Prota <gennaro_prota_at_[hidden]> writes:

> On Sun, 23 Mar 2003 17:17:03 +0100, Gennaro Prota
> <gennaro_prota_at_[hidden]> wrote:
>
>>the standard defines 'stack unwinding' as (15.2/3)
>>
>> The process of calling destructors for automatic objects
>> constructed on the path from a try block to a throw-expression
>>
>>Does this include the 'argument' of the call expression?
>>
>> throw A()
>>
>>Certainly the expression A() is part of the throw-expression, however
>>the quote above isn't particularly clear at saying whether "to a
>>throw-expression" is inclusive or not.
>
> Now that I think about it, I believe the initial copy of the exception
> object must logically be seen as a *part* of the evaluation of the
> throw-expression. Otherwise, i.e. if you make it a separate step, you
> either have to say that the temporary A() is not destroyed at the end
> of its full expression (the throw) or say that it is destroyed before
> you get a chance to copy it to a safe place. Don't you agree?

That sounds right. Would you like to post a proposed replacement (or
patch) for the page as written which addresses your points?

-- 
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