[RFC] alternate exception handling method

Sean Kelly sean at f4.ca
Fri Mar 17 22:36:20 PST 2006


BCS wrote:
> The proposal:
> 
>   Provide a mechanism that allows for the in-place handling of 
> exceptional cases. Rather than abandon the entire function call, when 
> this mechanism is encountered, the runtime environment searches back 
> through the call stack (much like with a normal throw) until it finds a 
> handler and executes it and then returns execution to the place that the 
> exception was raised. This could be used in cases where the exception 
> case might be an error but not always or in cases where the problem can 
> be fixed.

This was discussed back when exception handling was being designed for 
C++ and the idea was ultimately rejected as problematic.  I don't have 
any references regarding why offhand, but I remember it being mentioned 
in "The Design and Evolution of C++."  There's nothing stopping an 
application programmer from doing this now, however.  In fact, I do call 
error routines from time to time, instead of simply throwing an exception.


Sean



More information about the Digitalmars-d mailing list