Boost logo

Boost :

From: Carl Daniel (cpdaniel_at_[hidden])
Date: 2002-08-16 11:07:52

"Eric Woodruff" <Eric.Woodruff_at_[hidden]> wrote in message
> You can write a test application simple enough. I don't see how it could
> 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.



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