This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC Feature question
- From: "Michael Lovett" <mlovett at morpace dot com>
- To: <aldyh at redhat dot com>, <jason at redhat dot com>
- Cc: <gcc at gnu dot org>
- Date: Fri, 04 Oct 2002 15:06:41 -0400
- Subject: Re: GCC Feature question
Well, sometimes there are things you want to do locally in your code that don't necessarily involve object destruction, and you'd like these things to happen whether or not an exception was thrown. These are the types of things we are anxious for try/finally.
M
>>> Jason Merrill <jason@redhat.com> 10/01/02 01:30PM >>>
On 27 Sep 2002 20:42:56 -0700, Aldy Hernandez <aldyh@redhat.com> wrote:
> > We are porting apps to UNIX from Windows but so far can't find a
> > compiler with try/finally. It is such a useful, convenient construct
> > it is hard to imagine structured programming without it.
>
> C or C++? With C++ you can emulate it with constructors, albeit ugly.
It's not *that* ugly. For C++ using a destructor encourages you to write
reusable finalization code.
Jason