home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / std / cplus / 1774 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.1 KB  |  34 lines

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!marlin.jcu.edu.au!coral.cs.jcu.edu.au!spuler
  3. From: spuler@coral.cs.jcu.edu.au (David Spuler)
  4. Subject: exceptions, unexpected() and muddle_on()
  5. Message-ID: <spuler.724363604@coral>
  6. Sender: news@marlin.jcu.edu.au (USENET News System)
  7. Organization: James Cook University
  8. Date: 14 Dec 92 20:06:44 GMT
  9. Lines: 23
  10.  
  11.  
  12. On page 320, Stroustrup, 2nd edition, declares the function
  13.  
  14. void muddle_on() { cerr << "muddling on\n";  }
  15.  
  16. and installs it so as to be called by unexpected().
  17.  
  18. My question is: what happens if a function installed by set_unexpected returns?
  19. Stroustrup says
  20.  
  21. "This will cause a normal return from a function detecting an unexpected
  22. exception. .... "
  23.  
  24. I don't see how this can happen. 
  25. Does the throw expression return and execution continue from there??
  26. (Seems not since this could be way down deep in the stack.)
  27. Or does the function which raised the unexpected exception just return with a
  28. garbage return value?
  29.  
  30. The ARM seems to have nothing to say about set_unexpected functions returning.
  31.  
  32. Any insight appreciated,
  33. David Spuler
  34.