This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How would you write a finally clause in C++?


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]