Boost logo

Boost Users :

Subject: Re: [Boost-users] [exception] Using Boost.Exception infrastructure without using boost::exception
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2011-05-29 01:25:08


On Sat, May 28, 2011 at 10:21 PM, Mostafa
<mostafa_working_away_at_[hidden]> wrote:
> My Requirements:
> ----------------
> To use Boost.Exception tools to make my exceptions transportable between
> threads without explicitly or implicitly deriving from Boost.Exception.
>
> So it seems I'm halfway there with "throw
> boost::enable_current_exception(my_exception());".  Now I would like to
> rethrow from some catch site, it is my understanding then that I would need
> to use boost::rethrow_exception() (in order to stay within the parameters of
> my requirements).  But boost::rethrow_exception requires a
> boost::exception_ptr reference (which seems can only be gotten via
> boost::current_exception).  Now, does using "throw
> boost::enable_current_exception(my_exception());" with class my_exception
> which does not derive from boost::exception support the exception_ptr
> functionality that is need for boost::rethrow_exception?

Yes.

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


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