Boost logo

Boost :

Subject: Re: [boost] Policy proposal: All user-visible exceptions should be thrown through BOOST_THROW_EXCEPTION [was RE: Boost and exceptions]
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-06-25 17:13:49


On Mon, Jun 25, 2012 at 2:32 PM, Pete Bartlett <pete_at_[hidden]> wrote:

> > On 06/22/2012 02:23 PM, Stewart, Robert wrote:
>
> >There is no Boost policy that requires Boost.Exception support. If you
> think there should be, >then lobby for it.
>
> This thread has pushed me in the direction that this is the way to go. Here
> are some specific policy change proposals:
>
> 1) Mandate that all throws should be through BOOST_THROW_EXCEPTION and
> enforce through Boost.Inspect. or:
>
2) Strongly suggest in developer documentation that they should be through
> BOOST_THROW_EXCEPTION but drop short of mandating. or:
> 3) Better document and formalize existing practice (that user-visible
> exceptions should derive from std::exception, and that a developer may use
> BOOST_THROW_EXCEPTION and boost::throw_exception and may respect
> BOOST_NO_EXCEPTIONS, but isn't obliged to do so)
>
[...]

Regarding (1) and (2), I think one should have the option to simply use
boost::throw_exception. The additional file/function/line info may not be
very useful within a templated implementation detail, and, in any case,
such info is likely only useful/usable in a debugging context.

- Jeff


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