Boost logo

Boost :

Subject: Re: [boost] [config] Macro BOOST_NO_NOEXCEPT is required
From: Beman Dawes (bdawes_at_[hidden])
Date: 2011-04-24 17:37:17


On Sun, Apr 24, 2011 at 2:43 PM, Emil Dotchevski
<emildotchevski_at_[hidden]> wrote:
> On Sat, Apr 23, 2011 at 11:57 AM, Takaya Saito (SubaruG)
> <gintensubaru_at_[hidden]> wrote:
>> http://thread.gmane.org/gmane.comp.lib.boost.devel/214978
>>
>> I think the macro BOOST_NO_NOEXCEPT ( or BOOST_NO_0X_NOEXCEPT ) is
>> required soon.
>> How's the status now?
>
> The semantics of throw() and noexcept are not identical. Also, the
> semantics of throw() are not identical on all platforms.

I think the OP may have been asking for a macro to indicate that
"noexcept" isn't available. That's one issue.

OTOH, I think we do need a couple of macros to apply noexcept to
functions if available. I'm leaning toward BOOST_NOEXCEPT() and
BOOST_NOEXECPT_IF(Predicate)

You are right that such a macro shouldn't be used to blindly replace
"throw()" or even "Throws nothing", although the standard library has
been able to replace throw() in most cases. Guidelines for when and
when not to use noexcept should probably follow those used for the
standard library. See the beginning of
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3279.pdf,
Conservative use of noexcept in the Library. Unfortunately, those
guidelines were hurriedly written to meet the FDIS deadline, and
aren't as clear as they could be with a bit of careful editing. They
are also missing some of the actual guidelines used for the standard
library, such as not using conditional nothrow if the condition is
even slightly complex.

--Beman


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