
On Tue, Nov 25, 2008 at 19:32, Emil Dotchevski <emil@revergestudios.com> wrote:
Suppose your compiler doesn't call terminate() when exceptions propagate out of thread functions but you want to implement boost::thread in a way that's conformant with the standard (so, you are not the compiler, and can't use compiler magic.)
The only way to do this is to catch(...) and then call terminate(). The problem is, if you catch(...) you've just killed the stack trace your compiler could give you.
Why wouldn't an empty exception specification work? It seems like the unexpected() call should call terminate() without ever doing an explicit catch (...). Of course, this depends on the compiler implementing exception specifications properly, and since Visual C++ doesn't ("However, if an exception is thrown out of a function marked throw(), the Visual C++ compiler will not call unexpected" ~ http://msdn.microsoft.com/en-us/library/wfa0edys.aspx ), it might give exactly what Dave's contact wants. ~ Scott