Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!crackers!jjmhome!zinn!nuucp From: mjv@objects.mv.com (Michael J. Vilot) Newsgroups: comp.lang.c++ Subject: re: Exception handling Message-ID: <965@zinn.MV.COM> Date: 10 Oct 90 20:53:40 GMT Sender: nuucp@zinn.MV.COM Lines: 27 David Masterson asks: > Would it be valid to add a call to another function (say myf()) at the end of > main() ... Point is, is it valid to reset how exceptions are processed? The short answer is: Yes. Handlers for the same exception attached to different blocks are distinct. So, a handler for catching X's thrown from one block need not do the same thing as a handler for catching them in some other context. Note, however, two points: 1. For the set of handlers attached to the _same_ block, ``control is transferred to the nearest handler of an appropriate type ... the handlers for a try-block are tried in order of appearance. It is an error to place a handler for a base class ahead of a handler for its derived class since that would ensure that the handler for the derived class would never be invoked.'' [E&S, Ch 15] 2. ``An exception is considered handled upon entry to a handler.'' That is, it takes an explicit action to throw (or re-throw) in order to propagate an exception beyond a matching handler. Hope this helps, -- Mike Vilot, ObjectWare Inc, Nashua NH mjv@objects.mv.com (UUCP: ...!decvax!zinn!objects!mjv)