[Issue 15202] filter and randomCover do not work together
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Oct 14 12:56:13 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=15202
ag0aep6g at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |ag0aep6g at gmail.com
Resolution|--- |INVALID
--- Comment #1 from ag0aep6g at gmail.com ---
You're calling `front` without checking `empty`. The range documentation [1]
says: "Calling r.front is allowed only if calling r.empty has, or would have,
returned false." There's no mention of range implementations having to throw an
exception in such a case, so `filter`'s behavior isn't wrong.
I'm closing this as invalid. If you'd like `filter` to throw an exception here,
please file a new issue with severity set to "enhancement".
[1] http://dlang.org/phobos/std_range_primitives.html
--
More information about the Digitalmars-d-bugs
mailing list