Boost logo

Boost :

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


From: "Victor A. Wagner, Jr." <vawjr_at_[hidden]>
> At Tuesday 2002/08/13 12:03, you wrote:
> >From: "Eric Woodruff" <Eric.Woodruff_at_[hidden]>
> >Is it ever useful to know what the exception type is in this case? I
ask,
> >because it seems to me that there's no way to recover in this case, and
the
> >only reason for propogation is to give some possibility for a clean exit
> >instead of an abrubt halt. If you can't recover, then what need is there
> >for knowing the exception type?
>
> Some of us plan on using boost::thread to implement separation of call
and
> result.

I understand that, but unless the call is an autonomous task (i.e. it
accesses no shared resources), then you likely can't recover, and the type
of exception doesn't matter.

That said (again), I see two cases in which propogation could be useful with
explicit types:

* The call is an autonomous task. Rare in my experience, but a very valid
use case.
* The exception *was* properly handled within the thread (i.e. shared
resources are gauranteed to be in a valid and expected state) but you wish
to "rethrow" the exception so that it propogates to the calling thread.
Also a valid use case, though I'd expect this idea will lead to many
programmatic errors.

Like Mr. Abrahams, I question whether or not we can implement this, but I
guess I've at least answered my own question about whether or not it would
be useful. In some cases, yes, it will be. I'd personally favor handling
both use cases with explicit error handling mechanisms in my own code, but I
can understand the wish for library support.

Bill Kempf


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