
On Sat, May 28, 2011 at 9:50 PM, Mostafa
On Sat, 28 May 2011 21:01:56 -0700, Emil Dotchevski
wrote: On Sat, May 28, 2011 at 8:37 PM, Mostafa
wrote: 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.
boost::enable_current_exception enables the boost::current_exception/boost::exception_ptr support by returning an object that derives from boost::exception *and* the type of the passed object.
Therefore:
throw boost::enable_current_exception(my_exception());
satisfies the requirement for deriving from boost::exception without requiring my_exception to derive from boost::exception.
If that is so, then that fact is omitted from the documentation for boost::enable_current_exception, please see:
Ah right, my mistake! It returns a type that derives from an unspecified type and T. The documentation is correct. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode