Article View: comp.std.c++
Article #2516Re: tree or forest exception hierarchy?
From: Herb Sutter
Date: Sat, 11 Nov 1995 06:04
Date: Sat, 11 Nov 1995 06:04
34 lines
2383 bytes
2383 bytes
In article <47va08$8lb@gabi.gabi-soft.fr>, kanze@gabi-soft.fr (J. Kanze) wrote: >As far as I can see, all of the exceptions thrown by the standard >library derive from the class exception, so they form a tree, not a >forest. > >This seems logical to me; the isA relationship definitly holds, and >there is a fundamental relationship (as opposed to the case of an Object >class, from which everything derives). I would even suggest that unless >there were very strong motives for doing otherwise, applications base >their exception hierarchy on the one used by the standard library. I notice this isn't covered in Cline's online FAQ, but it is covered in his book (highly recommended: "C++ FAQs", Addison-Wesley, 1995, ISBN 0-201-58958-3). See Section 21, "Tactical Advice for Exception Handling", where the very first entry (FAQ #261) launches right into this question. BTW, I concur heartily with James' last remark. At the moment I can't imagine a motive for doing otherwise, actually, that couldn't be solved by simply gathering your own exceptions under a root that's derived from 'xmsg' (or 'exception'? is that the correct DWP name?) and ignoring the fact that you're in the tree when you want to ignore it. Herb ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Herb Sutter 2228 Urwin, Ste 102 voice (416) 618-0184 Connected Object Solutions Oakville ON Canada L6L 2T2 fax (905) 847-6019 --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<480rub$oi0@steel.interlog.com>Path:
arc1-ca.pugleaf.net!in1.uu.net!bounce-backReferences:
<30A0FD4D.D01@camis.stanford.edu> <47va08$8lb@gabi.gabi-soft.fr>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back Date: 11 Nov 95 06:04:21 GMT Approved: fjh@cs.mu.oz.au From: herbs@interlog.com (Herb Sutter) Newsgroups: comp.std.c++ Subject: Re: tree or forest exception hierarchy? X-Original-Date: Sat, 11 Nov 95 00:50:55 GMT Organization: Connected Object Solutions (div of Daystar Software Systems Design Inc.) Message-ID: <480rub$oi0@steel.interlog.com> References: <30A0FD4D.D01@camis.stanford.edu> <47va08$8lb@gabi.gabi-soft.fr> X-Newsreader: News Xpress Version 1.0 Beta #4 X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMKQ87+EDnX0m9pzZAQGr+QF9GpH1vzIRW2HwXXG8VivazFrBheMuSt99 SuwezVJLLj8HfqD6SH0bxQ/R+rRXu5Rh =310y