
On Tue, Nov 25, 2008 at 12:26 PM, David Abrahams <dave@boostpro.com> wrote:
on Tue Nov 25 2008, "Emil Dotchevski" <emil-AT-revergestudios.com> wrote:
Maybe I'm missing something but what in the upcoming standard requires the catch(...)?
The requirement that terminate() be called when the exception isn't otherwise caught. Of course you can do it with "compiler magic" because the standard doesn't specify an implementation. Practically speaking, though, it means a catch(...) in the library.
I don't follow. It means that no exception should propagate out of the thread function. In other words, if an exception propagates out of the thread function, that's a bug. In this case, the call to terminate() is reasonable. As a bonus, a standard-conforming implementation can also display a stack trace. Anyway, automatic catch(...) in boost::thread is not necessary IMO. To me that's like having an automatic catch(...) in main(). This doesn't mean that it's always a bad idea, only that the decision to use catch(...) is outside of the scope of boost::thread. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode