Article View: comp.std.c++
Article #3459Re: Exceptions and Destructors
From: Fergus Henderson
Date: Thu, 15 Feb 1996 15:42
Date: Thu, 15 Feb 1996 15:42
26 lines
1703 bytes
1703 bytes
bglenden@colobus.aoc.nrao.edu (Brian Glendenning) writes: >As I understand it, an object is only considered constructed when its >constructor has finished, so that an exception thrown from within that >constructor will not result in that object's destructor being >called. (Its completely constructed subobjects will be however). Right. >What about the destructor? Is the object considered destructed when >the destructor is *entered*, or when it *completes*? The object is considered "partially constructed" as soon as the destructor is entered. It is not completely destructed either. If an exception is thrown in the destructor, the destructor should not be called again, but destructors for base class sub-objects should be called as part of stack unwinding. -- Fergus Henderson WWW: http://www.cs.mu.oz.au/~fjh fjh@cs.mu.oz.au PGP: finger fjh@128.250.37.3 [ 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://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
Technical Details
Message-ID:
<4fv8kb$j1@mulga.cs.mu.OZ.AU>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageReferences:
<BGLENDEN.96Feb14173755@colobus.aoc.nrao.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson) Newsgroups: comp.std.c++ Subject: Re: Exceptions and Destructors Date: 15 Feb 1996 15:42:50 GMT Organization: Comp Sci, University of Melbourne Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <4fv8kb$j1@mulga.cs.mu.OZ.AU> References: <BGLENDEN.96Feb14173755@colobus.aoc.nrao.edu> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text X-Nntp-Posting-Host: munta.cs.mu.oz.au Content-Length: 894 X-Lines: 21 Originator: clamage@taumet