Boost logo

Boost :

Subject: Re: [boost] [config] Proposed BOOST_NOEXCEPT_NOTHROW macro
From: Beman Dawes (bdawes_at_[hidden])
Date: 2012-08-29 09:31:14

On Wed, Aug 29, 2012 at 7:48 AM, Stewart, Robert <Robert.Stewart_at_[hidden]> wrote:
> Beman Dawes wrote:
>> On Tue, Aug 28, 2012 at 6:27 PM, Vicente J. Botet Escriba
>> <vicente.botet_at_[hidden]> wrote:
>> > Le 28/08/12 23:22, Beman Dawes a écrit :
>> >
>> >> The three current BOOST_NOEXCEPT* macro variants miss the
>> >> case where C++03 code has a "throw()" throw-specifier.
>> >> Classes that derive from standard library exceptions need
>> >> this to avoid breaking code on C++03 compilers.
> I think I suggested the need for that in the beginning. It is an important case as you've found.

Yeah, I remember that now. Apparently it went over my head. Apologies.

>> >> I'm not enamored with the BOOST_NOEXCEPT_NOTHROW name, so
>> >> feel free to offer suggestions for alternate names.
>> >
>> I considered that, but was put off by its length.
>> BOOST_NOEXCEPT_OR_NOTHROW is clearer and the transition from
>> throw() to noexcept is confusing, so let's got with
> I agree that the name is long, but it is clear.
> What about BOOST_NOTHROW? It doesn't transition well to an all-C++11 world (only noexcept), but both throw() and noexcept mean the function emits (or should emit) no exceptions, so the name conveys the right idea. Maybe BOOST_THROWS_NOTHING to avoid the old connotation of "NOTHROW"?

My thinking was that there was some small advantage to beginning each
of the noexcept macros with BOOST_NOEXCEPT.

I worry that BOOST_THROWS_NOTHING would be misconstrued as a
replacement for "Throws: Nothing" specifications, and that isn't the
case. BOOST_NEVER_THROWS might be a bit better. But I think I still
prefer BOOST_NOEXCEPT_OR_NOTHROW. Or the original suggested


Boost list run by bdawes at, gregod at, cpdaniel at, john at