Article View: comp.std.c++
Article #4028Re: Use of standard exception classes
From: Greg Colvin
Date: Sun, 14 Apr 1996 12:30
Date: Sun, 14 Apr 1996 12:30
61 lines
2893 bytes
2893 bytes
In article <9604121530.AA08606@sun132.spd.dsccc.com> kcline@spdmail.spd.dsccc.com (Kevin Cline) writes: >In "The Standard C++ Library" on page 65, Plauger wrote: > > "I strongly encourage you to follow the lead of the Standard C++ > library in the use of exceptions: > * Throw only objects of one or more classes derived from [exception] > Good advice. >Page 19-1 of the 4/95 version of the draft says "The Standard C++ >library provides classes to be used to report errors in C++ programs." > True. >But in section 19.1.1 of the same draft it says: > >"The class exception defines the base class for the types of objects > thrown as exceptions by *C++ Standard library components*, and certain > expressions, to report errors detected during program execution." > Also true. >Can someone on the committee indicate whether it was the committee's >intention for the standard exception class hierarchy to be used in >general C++ programming, or whether the intention was for the standard >exception class hierarchy to be reserved to the Standard C++ library? > The intention was for the exception class hierarchy to serve well as a basis for your own exception classes and as all the concrete exception classes the library itself needs. You can derive from exception, which is almost an abstract class, or you can derive from its derivatives. >Another developer on our team has asked > How can we be sure that ANSI C++ library callbacks work > correctly in the face of exceptions? What if ANSI C++ > library code catches *our* exception? > Not to worry. >Is this a problem, or are library functions required to reraise any >exceptions thrown by client code? > Client exceptions are intended to be pass through library code uncaught, or at least reraised. Greg Colvin gregor@netcom.com --- [ comp.std.c++ is moderated. To submit articles: try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ] [ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ] [ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Technical Details
Message-ID:
<gregorDpsBEt.Dw0@netcom.com>Path:
arc1-ca.pugleaf.net!in1.uu.net!bounce-backReferences:
<9604121530.AA08606@sun132.spd.dsccc.com>Show Full Headers
Complete Article Headers
From: gregor@netcom.com (Greg Colvin) Message-ID: <gregorDpsBEt.Dw0@netcom.com> X-Original-Date: Sat, 13 Apr 1996 05:04:05 GMT Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back Date: 14 Apr 96 12:30:24 GMT Approved: fjh@cs.mu.oz.au Newsgroups: comp.std.c++ Subject: Re: Use of standard exception classes Organization: Netcom Online Communications Services (408-241-9760 login: guest) References: <9604121530.AA08606@sun132.spd.dsccc.com> Apparently-To: comp-std-c++@uunet.uu.net X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMXDv/eEDnX0m9pzZAQETIQGAjLWxTbIlC+hHuqQ0Kdc6E0a9h2Ed4IOs DmWBoQB1zFgRgRZxx+Q7LFXn/JpFY/Xx =tidc