Article View: comp.std.c++
Article #2697Re: Exceptions in derived class destructors
From: Dick Menninger
Date: Tue, 21 Nov 1995 16:39
Date: Tue, 21 Nov 1995 16:39
33 lines
2202 bytes
2202 bytes
> ==========Steve Clamage, 11/18/95========== > Apart from all of that, it is unlikely to be a good idea to throw > an exception from a destructor. It would be safer and less likely > to leave the program in an unknown state to use some other error- > reporting method for destructors. I wanted to add to my previous reply to this post, but it is not back yet. This is even more basic in that it is pretty much unavoidable that destructors will throw exceptions and the language must handle that well. A destructor is likely to need to call other stuff that can throw exceptions even if it does not directly throw them. If it destructs heap objects its members point at, then either you preclude the heap management from throwing exceptions or you plan for the language handling exceptions in destructors. I don't buy the statement that some other reporting method has got to be better. That sounds like you are saying we put exceptions in but we did not mean it. Don't get cold feet. Go ahead and finish dealing with all of the implications of fully putting them in. Good Day Dick Dick.Menninger@DaytonOH.ATTGIS.COM [ 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:
<DIEJGv.BEC@falcon.daytonoh.attgis.com>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageReferences:
<48m6b8$2ll@engnews1.eng.sun.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: Dick Menninger <Dick.Menninger@daytonoh.attgis.com> Newsgroups: comp.std.c++ Subject: Re: Exceptions in derived class destructors Date: 21 Nov 1995 16:39:32 GMT Organization: AT&T Global Information Solutions Sender: News administrative Login <news@falcon.daytonoh.attgis.com> Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <DIEJGv.BEC@falcon.daytonoh.attgis.com> References: <48m6b8$2ll@engnews1.eng.sun.com> Reply-To: mennid <Dick.Menninger@daytonoh.attgis.com> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text X-Nntp-Posting-Host: 149.25.99.44 X-Newsreader: DiscussIT 2.5.1.3 for MS Windows [AT&T Software Products Division] To: undisclosed-recipients.;@daytonoh.attgis.com Content-Length: 1127 X-Lines: 29 Originator: clamage@taumet