Boost logo

Boost :

Subject: Re: [boost] [inspect] exceptions (FW: [Boost-users] no exceptions)
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-03-24 21:04:33


At Thu, 24 Mar 2011 17:49:55 -0700,
Emil Dotchevski wrote:
>
> On Thu, Mar 24, 2011 at 4:50 PM, Dave Abrahams <dave_at_[hidden]> wrote:
> > At Thu, 24 Mar 2011 11:27:23 -0700,
> > Emil Dotchevski wrote:
> >>
> >> > That said, "libraries should generally use BOOST_THROW_EXCEPTION" is a
> >> > good rule for Boost, and I wouldn't mind having something like it in
> >> > the inspect tests, provided that libraries with a legitimate reason
> >> > not to use it can be registered as exceptions to the rule.
> >>
> >> Maybe I'm missing something but what is an example of such a legitimate reason?
> >
> > For example, "it buys nothing, because the library can't really work
> > as coded without exception support."  Such is the case for
> > Boost.Python, I believe.
>
> Whether it makes the library useful in BOOST_NO_EXCEPTIONS builds is
> best left for the user of the library to decide.

No, really. Python throws exceptions as a matter of course (e.g. loop
termination). These get translated into C++ exceptions.

> At any rate, you gain nothing from not using BOOST_THROW_EXCEPTION.

One fewer dependencies? Not that I really care; I'd be happy to use
it. It's just that it's also very easy for me to imagine that some
libraries might be exceptions to the rule.

> Besides, even if the library remains useless in BOOST_NO_EXCEPTIONS
> builds, I wouldn't say that BOOST_THROW_EXCEPTION buys nothing.

What does it buy in this case?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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