Re: Exceptions as smart pointers
On Aug 7, 10:05 pm, "Sergey P. Derevyago" <non-exist...@iobox.com>
wrote:
But there exist some points that deserve C++ specific attention. And one
of these points is "exceptions being thrown as smart pointers to actual
exception objects".
This is an interesting technique. It might be interesting to note that
it has been discovered independently (the paper by Alisdair Meredith
credits Bronek Kozicki and the BSI panel):
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2509.html
The variation in the paper avoids the need to throw smart pointers by
taking advantage of a new C++0x feature that allows one to obtain a
smart pointer to the currently active exception:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html
I, personally, would have preferred the N2509 functionality to go
directly into std::exception, but this would have raised ABI
compatibility issues.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]