
Emil Dotchevski wrote:
On Thu, Aug 28, 2008 at 9:21 PM, vicente.botet <vicente.botet@wanadoo.fr> wrote:
The main problem comes from the fact exception_ptr current_exception() do not works for any exception. So Emil has found that boost::throw could be used to throw a boost::exception wrapping the intendeed exception. IMHO, the exception_ptr emulation (without language support) to transport exceptions between threads is not of real use if current_exception() do not works for any exception.
As per http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html current_exception works for any exception. This is what we should aim for.
Antony has already provided a MSVC-specific implementation that works for any exception. As soon as I find the time to integrate this into Boost Exception, boost::enable_current_exception will be a noop on MSVC.
In principle, every compiler has the machinery necessary to implement current_exception completely non-intrusively. I am not a compiler expert, but it seems likely that compiler-specific solution should be possible for GCC as well.
No. I've tried, and it doesn't work. On the positive side, GCC 4.4 will have native support for exception_ptr for some platforms (not x86, but x86_64), and GCC 4.5 will hopefully support it everywhere. Sebastian