[Issue 19041] New: errnoEnforce: example does not compile
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jun 29 10:08:56 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19041
Issue ID: 19041
Summary: errnoEnforce: example does not compile
Product: D
Version: D2
Hardware: Other
OS: Other
Status: NEW
Severity: enhancement
Priority: P1
Component: dlang.org
Assignee: nobody at puremagic.com
Reporter: kdevel at vogtner.de
https://dlang.org/phobos/std_exception.html#errnoEnforce
---
auto f = errnoEnforce(fopen("data.txt"));
auto line = readln(f);
enforce(line.length); // expect a non-empty line
---
Doc needs an example which compiles.
https://forum.dlang.org/thread/yctbgblmfaagujoiznxt@forum.dlang.org
--
More information about the Digitalmars-d-bugs
mailing list