[Issue 14543] New: std.algorithm.searching.until does not handle range sentinels nicely
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon May 4 03:09:46 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14543
Issue ID: 14543
Summary: std.algorithm.searching.until does not handle range
sentinels nicely
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: jakobovrum at gmail.com
Current behaviour:
void main()
{
import std.algorithm;
assert("one two three".until("two", OpenRight.no).equal("one t"));
}
It's probably safe to say the user expected the result to be equal "one two".
Range sentinel values aren't in the tests, so it's probably safe to say `until`
was not designed with range sentinels in mind.
--
More information about the Digitalmars-d-bugs
mailing list