nothrow by default
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Thu Jan 9 13:26:36 UTC 2020
On Thursday, 9 January 2020 at 10:32:25 UTC, Jonathan M Davis
wrote:
> On Wednesday, January 8, 2020 11:26:41 PM MST Walter Bright via
> Digitalmars- d wrote:
>> I'm aware that C++ is moving away from exceptions. I've been
>> unhappy with exceptions for some time now (DMD doesn't use
>> them for performance reasons), and C++ has evidently come to
>> the same conclusion.
>>
>> I expect that exceptions will soon become a legacy feature.
>
> I would really hope not. IMHO, they are usually by far the best
> way to handle error conditions in a program. Anything else
> results in you having to deal with the various possible error
> conditions when the function returns, which is _far_ more
> unwieldy and much more error-prone. It also doesn't work well
> with function call chaining.
I doubt Stroustrup will let that happen. Highly unlikely scenario.
Not sure why anyone would think that exceptions are gone just
because some want to enable compilers configured to compile
without exceptions to use more library containers (like
std::vector)?
C++17 certainly introduced new exceptions
(std::filesystem::filesystem_error), and I believe more C++
setups enable exceptions today than a decade ago. For good
reasons.
No need to avoid exceptions in the whole program just because you
don't want them in som specific locations (like render code).
Whole program analysis and inter-procedural analysis should be
able to take care of it.
More information about the Digitalmars-d
mailing list