Boost logo

Boost Users :

Subject: Re: [Boost-users] [exception] Using Boost.Exception infrastructure without using boost::exception
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2011-05-28 23:37:23


On Sat, 28 May 2011 20:24:53 -0700, Emil Dotchevski
<emildotchevski_at_[hidden]> wrote:

> On Sat, May 28, 2011 at 8:05 PM, Mostafa
> <mostafa_working_away_at_[hidden]> wrote:
>> On Sat, 28 May 2011 18:56:23 -0700, Emil Dotchevski
>> <emildotchevski_at_[hidden]> wrote:
>>
>>> On Sat, May 28, 2011 at 6:27 PM, Mostafa
>>> <mostafa_working_away_at_[hidden]>
>>> wrote:
>>
>> <snip>
>>
>>> If you want to use the error info or exception_ptr functionality, the
>>> exception being thrown must derive from boost::exception.
>>
>> The feature I'm only interested in is using Boost.Exception to enable my
>> exceptions to be "thread-safe" without explicitly or implicitly deriving
>> from boost::exception.
>
> How do you define thread safety for exception objects? The only thread
> safety guarantees provided by Boost Exception relate to
> boost::exception_ptr objects.

The ability to transport exceptions between threads (yes, I may have been
misusing the term in my previous posting), as is mentioned here:
http://www.boost.org/doc/libs/1_46_1/libs/exception/doc/tutorial_exception_ptr.html

> All of the Boost Exception functionality works only if the exceptions
> derive from boost::exception. Your only two choices are to do it
> explicitly or to call boost::throw_exception which does it for you.

It seems that some functionality doesn't, namely
boost::enable_current_exception, and I was hoping to leverage such
functionality to achieve my aforementioned goal.

Even if it's not possible to fulfill my requirement using the existing
tools in Boost.Exception, I still would be interested in knowing if it's
possible to expand Boost.Exception to realize such a feature.

Thanks,

Mostafa


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