Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!zweig From: zweig@cassius.cs.uiuc.edu (Johnny Zweig) Newsgroups: comp.lang.c++ Subject: Re: Exception Handling in C++ Message-ID: <1990Apr13.034540.10997@brutus.cs.uiuc.edu> Date: 13 Apr 90 03:45:40 GMT References: <680@mead.UUCP> Sender: news@brutus.cs.uiuc.edu Reply-To: zweig@cs.uiuc.edu Distribution: usa Organization: U of Illinois, CS Dept., Systems Research Group Lines: 40 dianne@mead.UUCP (Dianne Glickfield) writes: >Hello, > I was wondering if anyone could give me some information on the exception >handling design that Bjarne Stroustrup and Andrew Koening presentend and the >" C++ at Work " conference in November 1989. I would be interested in hearing >what was said. Email or posting is fine. Thanks in advance. >_______ >Dianne Steele Glickfield Product Delivery Systems Bjarne gave a talk about the revised/ANSIfied version of this at the USENIX C++ Conference in San Francisco the day before yesterday. Michael Tiemann told us that G++ 1.36 has a similar mechanism (and he seemed to say that he would probably change it to match Bjarne's specification in the new paper, though he was unclear on the point). The basic idea is to introduce blocks with exception-handlers like: try { //some code which might say "throw Foo();" or "throw Bar();" } catch(Foo f) { //f is an object of type Foo which is the exception -- it's //constructor could take arguments so the exception can tell you stuff } catch(Bar b){ //ditto } There is also a way that a function can declare what exceptions it might raise to allow type-safe exception handling (whether functions that lack a throw-clause are saying they can generate any exception or no exception is unclear to me; it makes a big difference in what you can do and there is a nice religious safety vs. flexibility argument associated with which it is -- I'll read the paper and post which it is if noone else comments). So wait until your local library gets a copy of the proceedings and all will be revealed. -Johnny Exceptional