Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-08-13 16:16:17


From: "Victor A. Wagner, Jr." <vawjr_at_[hidden]>

> At Tuesday 2002/08/13 13:01, you wrote:
> >From: "Victor A. Wagner, Jr." <vawjr_at_[hidden]>
> > > >
> > > >Even that's not enough; you need to know the order in which to look
for
> > > >them:
> > > >
> > > >try { something(); }
> > > >catch(std::exception) {
> > > > std::cout << "x";
> > > >}
> > > >catch(std::bad_alloc) {
> > > > std::cout << "y";
> > > >}
> > > >
> > > >Never prints "y".
> > >
> > > of course. the texts I read on exceptions made this quite clear. I
don't
> > > see this as any sort of a "problem".
> >
> >Yes, but the user won't be writing that in this case. It's important to
> >recognize the limitations of any such system. What does the user
actually
> >need to get right in order to make it work? He must supply a complete
list
> >of every concrete exception type that may escape the thread sorted in
> >reverse topographical order.
>
> I believe I proposed automagically handling the collection of
> std::exception as one of the policies. I remember offering to assist in
> writing such a thing.

Ugh. My point is more general. There are other hierarchies, and there are
other exceptions derived from std::exception which you can't handle
"automagically". I don't know whether that's significant or not, but it's
worth evaluating.

-----------------------------------------------------------
           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