Boost logo

Boost Users :

Subject: Re: [Boost-users] How to store on exception object ?
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2010-08-31 13:07:40


On Aug 31, 2010, at 10:00 AM, Timothy Madden wrote:

> On 8/31/2010 6:04 PM, Steven Watanabe wrote:
>> AMDG
>>
>> Timothy Madden wrote:
>>> However how can I store a thrown object for later re-throw without the
>>> actual exception type ? Is there a way to do that ?
>>
>> I think this is what boost::exception_ptr is for.
>> http://www.boost.org/libs/exception/doc/exception_ptr.html
>
> It looks like that only works as long as every throw site uses enable_current_exception to throw.

Yes, that's a limit of the library-only approach of Boost.Exception. On the other hand, unless you have compiler support (C++0x has exception_ptr too), it's the best you'll get.

Sebastian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net