From 5624464379675835908
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,96a8c01f7043c2d9
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-09-17 16:08:42 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!212.74.64.35!colt.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: pierrebai@hotmail.com (Pierre Baillargeon)
Newsgroups: comp.std.c++
Subject: Re: Proposal: exception stack unwinding resumption
Date: Tue, 17 Sep 2002 23:08:41 +0000 (UTC)
Organization: http://groups.google.com/
Lines: 40
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <6df0c6a8.0209170602.2cb54634@posting.google.com>
References: <6df0c6a8.0208260746.633710cb@posting.google.com> <tHkd9.24180$5g6.553497@newsfep2-win.server.ntli.net> <6df0c6a8.0209051026.5df687db@posting.google.com> <ar_e9.1193$Yc7.36404@newsfep2-gui> <6df0c6a8.0209100534.619b8531@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>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: mail2news.demon.co.uk 1032304121 28459 10.0.0.1 (17 Sep 2002 23:08:41 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Tue, 17 Sep 2002 23:08:41 +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 17rRSR-0007Os-00
	for mail2news@news.news.demon.net; Tue, 17 Sep 2002 23:08:40 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id JAA13471; Wed, 18 Sep 2002 09:08:06 +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: 17 Sep 2002 14:02:20 GMT
Xref: archiver1.google.com comp.std.c++:13983

Allan_W@my-dejanews.com (Allan W) wrote in message news:<23b84d65.0209161107.23bea618@posting.google.com>...
> > Garry Lancaster:
>
> ...

Frankly, I'm starting to find this thread pointless. All replies go
along the same lines: it's dangerous to throw from destructors, so
don't do anything in destructors. No one considers the alternative: if
it were not dangerous to throw from destructors we could do useful
things in destructors.

All suggestions always have to do with putting the header/footer pair
in a function with the body either a virtual function or templated.
They all fail to address the usability problems. The usability
problems are:

- Having to put code in a separate function/object/class.
- Not having access to local variables.
- Spreading the code in many places, making it harder to
read/understand.
- One-use code forced to be put in a reusable function/object/class.
- Harder to nest multiple levels of arbitrary headers/footers.

Some claim that the destructor will somehow corrupt the data, but it
can be avoided *easily* with a single if. I don't only because I don't
need that capability.

The need is simple: have an automated, reusable and usable way to have
a pair of functions called around a piece of code.

As far as claim to abuse of the RAII name, I agree, but the concepts
are related: RAII is a specialized subset of the other, only taking
resources into consideration.

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



