nothrow by default

Jonathan M Davis newsgroup.d at jmdavisprog.com
Sat Jan 4 20:44:23 UTC 2020


On Saturday, January 4, 2020 9:05:10 AM MST Steven Schveighoffer via 
Digitalmars-d wrote:
> Just wanted to bring this up, and not muddy the other thread.
>
> What do you put if you throw? @safe by default has alternatives. nothrow
> does not. Are we going to get a new keyword/uda?

We really should add a way to negate all of the attributes regardless of the
defaults, but nothrow by default would be terrible IMHO. Aside from really
performance-sensitive code, exceptions are usually the best and cleanest way
to deal with error conditions that aren't bugs. If nothrow were the default,
either we'd have to slap whatever the equivalent of !nothrow would be all
over the place, or exceptions would be seriously compromised as a means of
error handling.

- Jonathan M Davis





More information about the Digitalmars-d mailing list