
3 Oct
2007
3 Oct
'07
3:49 p.m.
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