|
Boost : |
From: Eric Woodruff (Eric.Woodruff_at_[hidden])
Date: 2002-08-13 15:25:22
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>.)
Using the paradigm ubiquitously eliminates the fork between threaded and
non-threaded versions of their functions and allows hierarchical exception
specifications to thread<>.
----- Original Message -----
From: David Abrahams
Newsgroups: gmane.comp.lib.boost.devel
Sent: Tuesday, 2002:August:13 3:09 PM
Subject: Re: Re:
Re:Re:Re:Re:Re:Re:AttemptingresolutionofThreads&ExceptionsIssue
From: "Eric Woodruff" <Eric.Woodruff_at_[hidden]>
> If a user absolutly needs to use an abstract exception type, we can at
least
> give them the type_info::name () of the type that was thrown.
That only works if their exception type has a virtual function. There's no
reason an exception base class must have virtual functions.
-----------------------------------------------------------
David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com
_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk