🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #728

Re: Exception Specifications

#728
From: Stephen Vinoski
Date: Thu, 01 Oct 1992 14:36
31 lines
2152 bytes
In article <1992Sep30.205656.10646@lucid.com> jss@lucid.com (Jerry Schwarz) writes:
>At the moment X3J16 is considering the implications of exceptions
>for stream classes.  Some think that streams should only
>be able to throw a particular kind of exception (tentatively
>named ios::failure). Others (including myself) feel that a stream
>should be able to throw an arbitrary exception. Remember, users
>can define their own kinds of streambufs, so X3J16 can't know in advance
>what kinds of conditions they might want to report.  
>
>My intuition (not based on experience I confess) is that in
>general it is more important to get specific information about
>the conditions that caused an exception than it it to know that
>it in occured in some stream operation. That is, it is better to
>know that there was an "out of memory" or "database corruption" problem
>than it is to know that there was a problem while doing a stream
>operation.  This leads me to the conclusion that the iostream library
>should not use failure clauses.

It seems like a compromise -- making ios::failure into a base class
from which other more specific exception types can be derived -- would
be the best approach.  Application code that can do something useful
with specific exceptions can then arrange to catch each one
individually, while code that cares only that an exception was thrown
but does not wish to catch each different type can arrange to catch
only the base class.

-steve
-- 
Steve Vinoski  (508)436-5904   vinoski@apollo.hp.com
Distributed Object Computing Program
Hewlett-Packard, Chelmsford, MA 01824       These are my opinions.
Technical Details
Message-ID: <BvG5wF.2BF@apollo.hp.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!caen!sdd.hp.com!apollo.hp.com!netnews
References: <1992Sep29.201603.19289@cs.brown.edu> <1992Sep30.205656.10646@lucid.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++
Path: arc1-ca.pugleaf.net!sparky!uunet!caen!sdd.hp.com!apollo.hp.com!netnews
From: vinoski@apollo.hp.com (Stephen Vinoski)
Subject: Re: Exception Specifications
Sender: usenet@apollo.hp.com (Usenet News)
Message-ID: <BvG5wF.2BF@apollo.hp.com>
Date: Thu, 1 Oct 1992 14:36:14 GMT
References: <1992Sep29.201603.19289@cs.brown.edu> <1992Sep30.205656.10646@lucid.com>
Nntp-Posting-Host: zep_e.ch.apollo.hp.com
Organization: Hewlett-Packard Corporation, Chelmsford, MA
Lines: 31