This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: How would you write a finally clause in C++?
- To: Erwin Bolwidt <ejb at klomp dot org>
- Subject: Re: How would you write a finally clause in C++?
- From: Per Bothner <per at bothner dot com>
- Date: 27 May 2001 12:35:51 -0700
- Cc: <java at gcc dot gnu dot org>
- References: <Pine.LNX.4.33.0105272046470.5985-100000@galileo.zap.tm>
Erwin Bolwidt <ejb@klomp.org> writes:
> When you want to write a try {} finally {} clause in C++ in a CNI method,
> how would you do that?
The standard C++ idiom is to use a helper class with a finalizer. I
don't know of anything more convenient. Look at the implementation of
JvSynchronize for an example.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/