
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 15 April 2008 13:19, Sebastian Redl wrote:
I can use current_exception() to get the currently handled exception. However, calling it again will yield a null pointer. That's because I can't abuse handlerCount properly.
The exception_ptr works so far that it lets the exception escape the catch.
I can use rethrow_exception() to rethrow the exception. However, when I catch it again, it won't escape the catch. I.e.
Here's a partial proof-of-concept implementation of exception_ptr for Linux, tested on gcc 4.1.2. The unwind-cxx.h file is just a copy from the gcc source: gcc-4.1.1/libstdc++-v3/libsupc++/unwind-cxx.h. The test program demonstrates that you can rethrow more than once. There is no implementation for copy_exception() yet. If you call current_exception multiple times for one exception, it will probably crash. That should be fixable by adding a global/singleton map which would let you find if another exception_ptr already owns a particular exception object. - -- Frank -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIC05l5vihyNWuA4URAqg+AJ98TobpjS4c/FTeHe5A99s9ypqa8ACgsUL0 DKE8VEMc+KbX7z3J6lxj50Q= =hZv9 -----END PGP SIGNATURE-----