|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-14 18:31:21
----- Original Message -----
From: "David Abrahams" <david.abrahams_at_[hidden]>
> If so, there's a way out, but you have to let people catch our exceptions
> explicitly
>
> catch(thread_cancellation const& e) {throw;}
> catch(...)
Actually, you don't; you can provide this function instead:
void propagate_cancellation_exceptions()
{
try { throw; }
catch(cancellation) { throw; }
catch(...) {}
}
Users must call it in any catch(...) blocks that don't rethrow. At any
rate, Alexander's objections to the uncaught_exception() trick seem to be
moral, not technical, and I'm trying hard to be an amoral programmer so I
think we should do it ;-)
It's good to know that there's a real use for uncaught_exception(), most
other anticipated uses don't actually work.
However, if you don't provide the function above, users may end up with
"unknown exception" error reports caused by thread cancellation, so maybe we
need both. Alexander's trick is a safety net; the other one should always
take precedence.
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk