Boost logo

Boost Users :

Subject: Re: [Boost-users] How to store on exception object ?
From: Timothy Madden (terminatorul_at_[hidden])
Date: 2010-08-31 13:00:24


On 8/31/2010 6:04 PM, Steven Watanabe wrote:
> AMDG
>
> Timothy Madden wrote:
>> In a callback function I need to store and save an exception object
>> for until the callback is finished and the control is returned to my
>> application code. The callback is invoked by the C language code in
>> minizip library from zlib-1.2.3 contrib directory, and I need to throw
>> the exception when control returns to my application invoking minizip
>> functions.
>>
>> This is true for any exception that might get thrown and caught in my
>> callback, so I would like to do that for any exception type.
>>
>> 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.


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