enforce (i > 0) for i = int.min does not throw

kdevel kdevel at vogtner.de
Sat Jan 27 14:13:49 UTC 2018


I would expect this code

enforce3.d
---
import std.exception;

void main ()
{
    int i = int.min;
    enforce (i > 0);
}
---

to throw an "Enforcement failed" exception, but it doesn't:

$ dmd enforce3.d
$ ./enforce3
[nothing]




More information about the Digitalmars-d-learn mailing list