Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-11-20 13:43:24


At 01:20 PM 11/20/2002, Fernando Cacciola wrote:

>I'm not sure if a boost exception class is *needed*, but I see no problem

>in
>having one.
>Anyway, IIF such an exception class is defined, I *strongly* encourage
(as
>I
>did in the past) that it provides:
>
> virtual void raise() const
> {
> #ifndef BOOST_NO_EXCEPTIONS
> throw *this ;
> #endif

My naive expectation would be to call abort() if not wishing to handle
exceptions, but that really is a side issue. The bigger issue is whether or
not Boost should have a usual way of defining error exceptions thrown by
Boost libraries, with raise() being one of the issues to be dealt with.

> }
>
>and that boost libraries throw such exceptions *only* by calling
.raise():
>i.e. never with a throw expression directly in the user code.

I'm not sure if what we need is a class, a concept, or just some
documentation.

But it does seem that individual Boosters have figured out (presumably
better) ways to handle some aspects of reporting error exceptions. Would
anyone be interested in trying to refine that vague feeling into something
specific?

--Beman


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