Topic: Must exception classes have copy const
Author: clamage@Eng.sun.com (Steve Clamage)
Date: 1996/04/09 Raw View
In article 347@dub-news-svc-5.compuserve.com, Philippe Verdy <100105.3120@compuserve.com> writes:
>
>The reason why I am putting this submission is that I don't
>know why this scheme does not allow resumable exceptions:
Whether exceptions should be resumable was the subject of intense debate
over a period of two years early in the life of the C++ Committee. The
debate was not about how to implement them. The debate was about whether
the resumable model was appropriate for C++.
The short answer is that resumable exceptions impose a much higher
cost on all implementations and programs, even those that don't
want resumable exceptions, and that although sometimes you do want
to resume an exception, such cases are in practice rare. People with
extensive experience with resumable exceptions came to believe over
time that they were a mistake, and that you get better program designs
if you don't use them.
You can simulate resumable exceptions with non-resumable exceptions
if you need to, so only convenience and not functionality is lost by
the adopted language rule.
Debugging is a special case. In debug mode, you want to halt at the throw
point, not the catch point after the stack has been unwound. A reasonable
debugger will let you halt at the throw point.
Whether an uncaught exception is detected before or after stack unwinding
is up to the implementation. The implementation can choose to provide
a core dump or other diagnostic information as of the point of the
uncaught throw, for example, and reasonable implementations will make
that choice available.
---
Steve Clamage, stephen.clamage@eng.sun.com
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]