From -8113102201777508926
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,96a8c01f7043c2d9
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-09-23 11:29:15 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: news_comp.std.c++_expires-2002-10-01@nmhq.net (Niklas Matthies)
Newsgroups: comp.std.c++
Subject: Re: Proposal: exception stack unwinding resumption
Date: Mon, 23 Sep 2002 18:29:14 +0000 (UTC)
Organization: Team Rocket
Lines: 34
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <slrnaouku5.43d.news_comp.std.c++_expires-2002-10-01@moongate.nmhq.net>
References: <6df0c6a8.0208260746.633710cb@posting.google.com> <TbHf9.859$Pa7.63089@newsfep1-gui.server.ntli.net> <6df0c6a8.0209121133.6f081c37@posting.google.com> <e6jg9.4504$7x3.204560@newsfep2-win.server.ntli.net> <23b84d65.0209161107.23bea618@posting.google.com> <6df0c6a8.0209170602.2cb54634@posting.google.com> <RW_h9.899$nU2.53545@newsfep1-gui.server.ntli.net> <6df0c6a8.0209201925.6faa9e57@posting.google.com> <c87c1cfb.0209220939.46d823af@posting.google.com> <6df0c6a8.0209230602.2aba3ca8@posting.google.com> <+BUqU3G8b0j9Ewzr@robinton.demon.co.uk>
X-Trace: mail2news.demon.co.uk 1032805754 196 10.0.0.1 (23 Sep 2002 18:29:14 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 23 Sep 2002 18:29:14 +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 17tXxH-000031-00
	for mail2news@news.news.demon.net; Mon, 23 Sep 2002 18:29:12 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id EAA25808; Tue, 24 Sep 2002 04:28:34 +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-Orig-NNTP-Posting-Host: p508ae325.dip.t-dialin.net (80.138.227.37)
X-Orig-X-Trace: fu-berlin.de 1032803270 7835455 80.138.227.37 (16 [27100])
X-User-Agent: slrn/0.9.7.4 (Linux)
Xref: archiver1.google.com comp.std.c++:14144

On Mon, 23 Sep 2002 17:05:47 +0000 (UTC), Francis Glassborow <francis.glassborow@ntlworld.com> wrote:
>  In article <6df0c6a8.0209230602.2aba3ca8@posting.google.com>, Pierre 
>  Baillargeon <pierrebai@hotmail.com> writes
> >Tell me, what do you do in your destructors to have them not throw?
>  
>  I simply do not call functions that can throw.

Releasing many but the most trivial resources generally can result in an
error (take file handles for a very common example). What you are saying
is that such resources shouldn't be handled by RAII, or even when not
handled by RAII, shouldn't be handled while an exception is pending
(e.g. within a rethrowing catch block). 

This is a reasoning I find highly questionable. Conceptually, it is
perfectly sound to have situations where errors are accumulating before
you can handle any of them, and it's not generally true that only the
first one that happens to be thrown is the one of interest.

The only reason why never-throwing destructors are considered best
practice today in C++ is that its exception handling mechanism wasn't
designed to deal with more than one error at a time. I believe it's
very reasonable to think about how this situation could be improved, so
that less (or ideally no) information about errors gets lost.

-- Niklas Matthies
-- 
Help! The paranoids are after me!

---
[ 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                       ]



