Most basic nothrow, pure, @safe functions?

bearophile bearophileHUGS at lycos.com
Thu Mar 20 18:44:38 PDT 2014


Steven Schveighoffer:

> This is also a pure function:
>
> pure int foo()
> {
>    while(1) {}
>    return 0;
> }
>
> Pure doesn't mean "bug free".

Thankfully the D compiler catches the bug :-)

test.d(3,4): Warning: statement is not reachable

Bye,
bearophile


More information about the Digitalmars-d mailing list