|
Boost : |
Subject: Re: [boost] [inspect] exceptions (FW: [Boost-users] no exceptions)
From: Brian Wood (woodbrian77_at_[hidden])
Date: 2011-03-24 19:07:19
Dave Abrahams:
>At Wed, 23 Mar 2011 14:29:20 -0700,
>Emil Dotchevski wrote:
>> It is not independent matter because that is exactly what
>> BOOST_THROW_EXCEPTION guarantees, except when the library contains
>> try..catch or rethrows using throw without arguments, which are rare
>> cases. I agree that going the extra mile to workaround those
>> additional cases is usually unreasonable.
>
> I suppose that might be true, depending on your definition of "work
> properly." There's no such thing as "working properly without
> exceptions" if the library was coded for use with exceptions and you
> really need a recoverable response to, say, resource exhaustion.
>
> 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.
I think you are both more knowledgeable about exceptions and
this Boost library than I am, but here's my thinking. In the last 2
or 3 months I added a try/catch and throw without arguments to
a file in my library --
http://webEbenezer.net/misc/ReceiveCompressedBuffer.hh .
That's the only one so it is rare for me but there are a lot of libraries
that are bigger than my library. So I'm not sure it is rare in other
libraries. It seems to me that as a library grow this restriction is
just waiting for you to run into it. I guess it's a trade-off though
if I understand correctly.
-- Brian Wood Ebenezer Enterprises http://webEbenezer.net (651) 251-9384
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk