What is the point of nothrow?

wjoe none at example.com
Tue Jun 12 17:32:08 UTC 2018


On Tuesday, 12 June 2018 at 15:48:58 UTC, Bauss wrote:
>
> Ex.
>
> int a = array[400];
>
> Could yield a warning stating a possible a out of bounds error.
>
> Where:
>
> int a = array.length >= 401 ? array[400] : 0;
>

looks to me like a crash guard. Similar to something like this

void fn(Foo* foo)
{
   if (foo)
     //do stuff
}

program now crashes somewhere else when foo is null or invalid.


More information about the Digitalmars-d-learn mailing list