Boost logo

Boost :

From: Josh Napoli (jnapoli_at_[hidden])
Date: 2007-11-08 18:45:53

> Emil Dotchevski wrote:
> > > > Here is a generic exception_ptr implementation based on a
> > of
> > > > exception types. ( The
> > is
> > >
> > > If boost::throw_exception is modified such that its postcondition
> > > that the exception object it throws derives from boost::exception
> > > can't think of a reason not to), cloning can be implemented
> > > intrusively without a need for registration.
> >
> > I would hope to save exceptions thrown from 3rd party libraries. An
> > intrusive approach wouldn't work.
> For boost::throw_exception to be able to register the exception type
> from 3rd party libraries, they must call boost::throw_exception.

No, they don't need to call throw_exception. Registration of an
exception type can occur separately from the throw. For example, a user
could register an exception thrown by a binary-only library. Then
current_exception() would be able to clone exceptions from the
unmodified library, even if it uses a "bare" throw statement.

    //calls 'throw derived_error' and we can't change it to
    transfer_to_other_thread(current_exception()); //copies

However, as you pointed out, any types registered by a DLL would need to
be manually unregistered before the DLL is unloaded. This seems
unacceptable. Does boost::serialization have this problem?

Boost list run by bdawes at, gregod at, cpdaniel at, john at