nothrow by default
Paulo Pinto
pjmlp at progtools.org
Thu Jan 9 13:45:44 UTC 2020
On Thursday, 9 January 2020 at 13:26:36 UTC, Ola Fosheim Grøstad
wrote:
> 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.
Unfortunately Stroustrup only has its own vote and lobbying in
what concerns C++'s future, hence his set of advocacy papers
regarding C++'s roadmap.
As posted in another comment, C++/WinRT and Android NDK are two
such C++ setups.
More information about the Digitalmars-d
mailing list