From -457254743989559272
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,96a8c01f7043c2d9
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-09-28 05:10:16 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: belvis@pacbell.net (Bob Bell)
Newsgroups: comp.std.c++
Subject: Re: Proposal: exception stack unwinding resumption
Date: Sat, 28 Sep 2002 12:02:47 +0000 (UTC)
Organization: http://groups.google.com/
Lines: 39
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <c87c1cfb.0209271115.5145cfe6@posting.google.com>
References: <6df0c6a8.0208260746.633710cb@posting.google.com> <6df0c6a8.0209201925.6faa9e57@posting.google.com> <c87c1cfb.0209220939.46d823af@posting.google.com> <6df0c6a8.0209230602.2aba3ca8@posting.google.com> <c87c1cfb.0209231924.6b639ab2@posting.google.com> <6df0c6a8.0209240716.6fb5ec00@posting.google.com> <c87c1cfb.0209252107.70dc6f8e@posting.google.com> <ZRjjgCB9B1k9Ewft@robinton.demon.co.uk> <6df0c6a8.0209261901.36511fd8@posting.google.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: mail2news.demon.co.uk 1033214568 12235 10.0.0.1 (28 Sep 2002 12:02:48 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sat, 28 Sep 2002 12:02:48 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.05)
	id 17vGJ3-0003BC-00
	for mail2news@news.news.demon.net; Sat, 28 Sep 2002 12:02:45 +0000
X-Received: by mulga.cs.mu.OZ.AU
	id WAA01841; Sat, 28 Sep 2002 22:02:41 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ncar.ucar.edu
X-Newsgroups: comp.std.c++
X-NNTP-Posting-Date: 27 Sep 2002 19:15:23 GMT
Xref: archiver1.google.com comp.std.c++:14290

pierrebai@hotmail.com (Pierre Baillargeon) wrote in message news:<6df0c6a8.0209261901.36511fd8@posting.google.com>...
> francis.glassborow@ntlworld.com (Francis Glassborow) wrote in message news:<ZRjjgCB9B1k9Ewft@robinton.demon.co.uk>...
> > 
> > I maintain that any dtor that _needs_ to throw is perverting the 
> > semantics of destructors.  If it does not need to throw then it should 
> > not do so under any circumstances.
> 
> I respect your opinion and design choices, but is this a valid reason
> to actively resists having the C++ language support those that would
> like to write such code?
> 
> Many things about C++ bother many people, yet the language doesn't
> force anything down anyone's throat. My proposal doesn't force you to
> use destructors that throw, and its formulation should not incur any
> cost if your destructor don't throw. So what is the harm?

It allows you to subvert the guarantees about exception propagation.

It also allows you to write code that subverts the guarantee that
objects are properly destroyed. C++ bends over backwards to make this
guarantee; allowing language constructs to get around it introduces a
hole in the language, makes the language less consistent, creates the
possibility of subtle bugs, and adds no benefit.

The last point is worth elaborating: if destructors can silently
throw, what have you gained? Is your program more correct? Is it
easier to make correct? No. If a destructor throws and you ignore it,
all that's happened is you've ignored an error. This situation is
similar to ignoring error result codes, which is one of the problems
exceptions were invented to solve.

Bob

---
[ 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    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



