www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18319] New: std.exception: enforce example does not compile

https://issues.dlang.org/show_bug.cgi?id=18319

          Issue ID: 18319
           Summary: std.exception: enforce example does not compile
           Product: D
           Version: D2
          Hardware: Other
                OS: Other
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dlang.org
          Assignee: nobody puremagic.com
          Reporter: kdevel vogtner.de

The code

```
auto f = enforce(fopen("data.txt"));
auto line = readln(f);
enforce(line.length, "Expected a non-empty line.");
```

from

- https://dlang.org/phobos/std_exception.html#enforce, and
- https://dlang.org/library/std/exception/enforce.html

does not compile in any way.

https://forum.dlang.org/thread/ijtvcytskeswqtmlfirg forum.dlang.org#post-mailman.2691.1517085253.9493.digitalmars-d-learn:40puremagic.com

--
Jan 27