Boost logo

Boost :

From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2007-10-03 11:49:26


Tom Brinkman wrote:
> I wonder why my_error() is required. I wonder if a globaly
> static object, such as "boost::exception()" might be even cleaner
> and more lightweight.
It would be against the philosophy of Boost.Exception, which is that the
type of the error should be independent of the data the error carries.
The idea is that the type of the exception indicates the type of the
error, while all additional data is carried by the boost::exception
machinery.
A global boost::exception object would subvert this idea.

Oh, and you can't have just one such object, because multiple exception
objects might be active (even in a single thread), and if there's only
one storage area, you'd get in trouble with overriding data.

Sebastian Redl


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk