Boost logo

Boost :

From: William E. Kempf (williamkempf_at_[hidden])
Date: 2002-08-13 15:53:26


From: "Eric Woodruff" <Eric.Woodruff_at_[hidden]>
> Here's another alternative. Instead of relying on the reference-catching
> mechanism, which properly deletes behind the scenes, the user can use
> handles (shared_ptrs) of their exception they want to catch. They can
easily
> allocate their implementation of an abstract exception type on the heap
and
> pass it through correctly.

1) They can only do this if they are the ones who initiate the initial
throw. As Mr. Abrahams points out you don't know for sure what the
underlying type truly is if it's a polymorphic type, and so you'd likely
slice the object when copying it into the shared_ptr for "rethrow".

2) At this point you've put in so much code within the thread for handling
the exception I seriously question whether or not any extra support that I
could add to Boost.Threads would really be of any consequential benefit.

Bill Kempf


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