Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Modern C++ Features – keyword `noexcept`"

29 views
Skip to first unread message

Lynn McGuire

unread,
Jan 8, 2016, 11:07:36 PM1/8/16
to
"Modern C++ Features – keyword `noexcept`"
http://arne-mertz.de/2016/01/modern-c-features-keyword-noexcept/

I can honestly say that I have never used anything like this.

Lynn

Alf P. Steinbach

unread,
Jan 8, 2016, 11:08:42 PM1/8/16
to
It's only the last year (or two?) that all 2 relevant compilers for me
support pure `noexcept`. Previously I used a macro CPPX_NOEXCEPT defined
as `noexcept` or `throw()` depending on the compiler. That technique
left no room for conditional no-throw.

I think the apparently useless complication of a conditional no-throw
thing is probably in support of the misguided decision to not require
move constructors to be no-throw, which presents a problem for a
std::vector (the example used in the original paper by Dave Abrahams &
one other) when it needs to reallocate and move the old items.

As a result of that decision, std::vector is now not exception safe,
which is a bit nasty! :(


Cheers,

- Alf

0 new messages