Thread View: comp.std.c++
2 messages
2 total messages
Started by David Spuler
Mon, 14 Dec 1992 20:06
exceptions, unexpected() and muddle_on()
Author: David Spuler
Date: Mon, 14 Dec 1992 20:06
Date: Mon, 14 Dec 1992 20:06
23 lines
1152 bytes
1152 bytes
On page 320, Stroustrup, 2nd edition, declares the function
void muddle_on() { cerr << "muddling on\n"; }
and installs it so as to be called by unexpected().
My question is: what happens if a function installed by set_unexpected returns?
Stroustrup says
"This will cause a normal return from a function detecting an unexpected
exception. .... "
I don't see how this can happen.
Does the throw expression return and execution continue from there??
(Seems not since this could be way down deep in the stack.)
Or does the function which raised the unexpected exception just return with a
garbage return value?
The ARM seems to have nothing to say about set_unexpected functions returning.
Any insight appreciated,
David Spuler
Re: exceptions, unexpected() and muddle_on()
Author: Jerry Schwarz
Date: Tue, 15 Dec 1992 01:23
Date: Tue, 15 Dec 1992 01:23
17 lines
1070 bytes
1070 bytes
In article <spuler.724363604@coral>, spuler@coral.cs.jcu.edu.au (David Spuler) writes: |> |> My question is: what happens if a function installed by set_unexpected returns? |> Stroustrup says |> |> "This will cause a normal return from a function detecting an unexpected |> exception. .... " |> The current x3j16/sc22 working paper says "The unexpected() function [i.e. the one set by set_unexpected] may not return, but it may throw an exception. Handlers for the exception will be looked for starting at the call of the function whose exception-specification was violated." Thus the answer to the question is: undefined. -- Jerry Schwarz
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads