Boost logo

Boost :

Subject: Re: [boost] [config] Proposed BOOST_NOEXCEPT_NOTHROW macro
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2012-09-03 12:37:02

Jeffrey Lee Hellrung wrote:
> On Sun, Sep 2, 2012 at 9:19 AM, Dave Abrahams
> <dave_at_[hidden]> wrote:
> > on Wed Aug 29 2012, Roland Bock <>
> > wrote:
> > > On 2012-08-29 15:31, Beman Dawes wrote:
> > >>
> > >> 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_NOEXCEPT_AND_NOTHROW ? OR sounds like a choice.
> >
> > Should just be BOOST_NOEXCEPT, IMO.
> > Design for the future.
> We already have a BOOST_NOEXCEPT that expands to nothing in
> C++03, right? I understood the point of this proposed macro was
> to support those decorators on virtual functions that were
> "throw ()" in C++03 but got changed to "noexcept(true)" in
> C++11.

There are two cases. In C++03, some functions had to be
decorated with throw(), but most, even if they didn't throw, were
left with no decoration because throw() is a pain for multiple

Beman created BOOST_NOEXCEPT to handle the latter case: a
function that throws, and hopefully is documented as throwing,
nothing becoming noexcept in C++11. Now he needs a macro that is
noexcept in C++11, but throw() in C++03.

Given that BOOST_NOEXCEPT has already been used for the former,
another name is needed for the latter.

"BOOST_NOTHROW" is short, conveys the right idea, but isn't
forward looking. Then again, when we can ignore C++03, s/BOOST_NOTHROW/BOOST_NOEXCEPT/ would bring all code into C++11
without harm.

Rob Stewart robert.stewart_at_[hidden]
Software Engineer using std::disclaimer;
Dev Tools & Components
Susquehanna International Group, LLP


IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

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