Topic: Exceptions handling
Author: Stephen Clamage <stephen.clamage@sun.com>
Date: Sat, 4 Nov 2000 04:32:23 GMT Raw View
On Mon, 30 Oct 2000 19:17:03 GMT, Leonid Romanov
<LeonidR@astrosoft.ru> wrote:
>
>The Standard does not explicitly specify whether a variable in
>exception-declaration should be initialized before the stack unwinding has
>started. In particular, if this variable is of a class type, it is not clear
>whether the copy-constructor for it should be called before the stack
>unwinding.
>
I think the standard is clear. At the point of the throw, the thrown
object is copied to a temp (15.1/3). Then the search for a handler
begins. If no handler is found, the scope is exited, and the search
continues until a handler is found. The stack is unwound up to that
point, and the handler is entered (15.3/7-8). Entry to the handler
consists of initializing the handlers exception parameter (if there is
one) with the temp (15.1/3).
---
Steve Clamage, stephen.clamage@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 ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]
Author: Leonid Romanov <LeonidR@astrosoft.ru>
Date: Mon, 30 Oct 2000 19:17:03 GMT Raw View
The Standard does not explicitly specify whether a variable in
exception-declaration should be initialized before the stack unwinding has
started. In particular, if this variable is of a class type, it is not clear
whether the copy-constructor for it should be called before the stack
unwinding.
Is there a definite consensus about that?
Leonid.
---
[ 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 ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]