|
Boost : |
Subject: Re: [boost] BOOST_NOEXCEPT macro?
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2011-02-17 19:02:23
On Thu, Feb 17, 2011 at 12:51 PM, Dave Abrahams <dave_at_[hidden]> wrote:
> On Thu, Feb 17, 2011 at 2:55 PM, Nevin Liber <nevin_at_[hidden]> wrote:
>> On 17 February 2011 11:45, Dave Abrahams <dave_at_[hidden]> wrote:
>>
>>> On Thu, Feb 17, 2011 at 11:36 AM, Alexander Fokin <apfokin_at_[hidden]>
>>> wrote:
>>> > I believe it's not that simple.
>>> >
>>> > As I remember, throw() means the same thing as nothrow only in MSVC.
>>> > For example, under GCC you'll have to use __attribute__((nothrow)).
>>> >
>>> > Correct me if I'm wrong.
>>>
>>> You're right. In general, throw() has runtime semantics and can
>>> produce runtime overhead in the form of increased executable size and
>>> occasionally reduced speed. noexcept has only compile-time semantics.
>>>
>>
>> noexcept has runtime semantics as well, doesn't it? If you are in a
>> function declared noexcept(true) and an exception tries to escape,
>> std::terminate is called.
>
> Grrr! Right, I forgot they added that behavior against my advice.
Do I understand correctly that they replaced the lame throw() standard
behavior, to call unexpected() if an exception attempts to propagate
out of the function, with calling std::terminate() instead? Am I
missing something, isn't this equally lame?
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk