On Tuesday, 17 February 2015 at 18:40:51 UTC, Matthias Bentrup
wrote:
On Tuesday, 17 February 2015 at 18:30:24 UTC, Jonathan Marler
wrote:
I thought of the same thing but then realized that it would be
impossible to ensure that the catch block wouldn't stomp on
that memory.
The catcher wouldn't stomp any more on the thrower's memory
than a function stomps on the memory of its caller. All the
data of the thrower is safe, because it is above the stack
pointer. The unwinding hasn't been done at that point.
That would be a deep change in language semantics. Think
scope(exit), scope(failure), destructors of structs.