Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-08-13 15:19:49


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.
>
> As long as the shared_ptr paradigm for hierarchical exceptions is used
> consistently, there is no problem. (That is unless the compiler has
trouble
> receiving a boost::shared_ptr<std::invalid_argument> as a
> boost::shared_ptr<std::exception>.)

What makes you think that would work? The types are not related by
inheritance any more than a std::invalid_argument* is related to
std::exception*.

> Using the paradigm ubiquitously eliminates the fork between threaded and
> non-threaded versions of their functions and allows hierarchical
exception
> specifications to thread<>.

it would if it worked.

-Dave

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


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