Boost logo

Boost :

From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2008-08-29 14:59:26


Emil Dotchevski wrote:
> On Thu, Aug 28, 2008 at 9:21 PM, vicente.botet <vicente.botet_at_[hidden]> 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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk