Article View: comp.std.c++
Article #2931Re: throw declarations
From: Claus Andre Faerber
Date: Thu, 14 Dec 1995 17:37
Date: Thu, 14 Dec 1995 17:37
27 lines
2017 bytes
2017 bytes
clamage@Eng.sun.com (08 Dec 95): > The current rule, related to the original question, is that function f4 > is OK, and an error results only if g actually exits via an exception. > The alternative would be to require that every function called have an > exception specification at least as restrictive as the calling function. ... or a try-catch statement, which catches other exceptions and must not re-throw them. > Such a rule would make exceptions specifications completely useless. If a function can throw an exception although it was declared as throw(), what's the point of having such a throw declaration at all ?? Wether a function can throw an exception or not could be documented with the meaning of the function parameters and the use of the function. Why does the compiler need to be told this, if it doesn't do anything to prevent functions from behaving differently ?? ================================================================================ Claus Andre Faerber <claus@faerber.muc.de> ================================================================================ ## CrossPoint v3.1 ## [ 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:
<5zlIdu73cDB@faerber.muc.de>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: claus@faerber.muc.de (Claus Andre Faerber) Newsgroups: comp.std.c++ Subject: Re: throw declarations Date: 14 Dec 1995 17:37:42 GMT Organization: ? Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <5zlIdu73cDB@faerber.muc.de> NNTP-Posting-Host: taumet.eng.sun.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; conversions="7bit" Content-Transfer-Encoding: 7bit In-Reply-To: <Pine.A32.3.91.951207084521.21417B-100000@zorglub.cae.ca> X-Mailer: CrossPoint v3.1 X-Lines: 23 Content-Length: 1162 Originator: clamage@taumet