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

Per Bothner
Sun May 27 12:28:00 GMT 2001

Erwin Bolwidt <> 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

More information about the Java mailing list