Boost logo

Boost :

Subject: Re: [boost] [c++1] BOOST_NOEXCEPT macros?
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-10-19 11:47:34


Domagoj Saric wrote:
> On 11.10.2011. 13:54, Beman Dawes wrote:
>
> > Good question. There are two cases:
> >
> > (1) For C++03 compilers, the macro user wants the mentioned
> > compiler specifics. That's the case an additional macro is
> > needed for.
> >
> > (2) For C++03 compilers, the macro user wants nothing
> > inserted. That's the case covered by the macros I've added to
> > trunk. This case arises because a lot of existing code isn't
> > decorated with either throw() or a compiler specific
> > attribute, and the user doesn't want to add that now. In
> > applying noexcept to the standard library, this was by far
> > the most common situation encountered - there was no existing
> > exception specification.
> >
> > Note that cases (1) and (2) may be interleaved in the same
> > translation unit, so using a config macro to specify the
> > behavior won't work well, and isn't a preferred approach
> > anyhow.
>
> I must say I still don't see why (1) would require an
> additional macro because I don't see why (2) would be
> required/wanted at all..? IOW why would someone want
> noexcept but not __attribute__(( nothrow ))?

Using (1) on existing code could change behavior. Using (2) leaves existing behavior unchanged while paving the way for using noexcept in C++11.

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

________________________________

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 acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk