|
Boost : |
From: Carl Daniel (cpdaniel_at_[hidden])
Date: 2002-08-16 11:07:52
"Eric Woodruff" <Eric.Woodruff_at_[hidden]> wrote in message
news:057d01c2453b$cb923960$1800000a_at_soy...
> You can write a test application simple enough. I don't see how it could
be
> allocated on the stack when the stack is going to be immediately unwound,
> but I'll take your word for it.
No test application is needed - I know MSVC (and other compilers, I assume)
work this way. The exception can be allocated in the throwers stack because
the stack is not "deallocated" until after the catch clause exits.
Destructors of objects with automatic storage will have been called
(exception for the exception object itself, of course), but the stack space
remains "valid" (i.e. "above" the stack pointer) until after the catch is
exited. This allows MSVC to optimize-away the copy that logically occurs.
>
> It doesn't matter at this point. I certainly don't want to depend on luck
> when there's other ways to do it.
'zactly.
-cd
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk