[Issue 17679] New: SortedRange.contains should be deprecated in favor of the generic canFind
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Jul 24 13:23:57 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17679
Issue ID: 17679
Summary: SortedRange.contains should be deprecated in favor of
the generic canFind
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: greensunny12 at gmail.com
Since https://github.com/dlang/phobos/pull/4907, find takes advantage of
Sortedness:
https://github.com/dlang/phobos/blob/57b8d2511ea37cd01665b9b663d8ba246144b1f9/std/algorithm/searching.d#L1509
Hence, there's no need for the confusing `contains` method and it should be
deprecated in favor of `canFind`.
See also: http://forum.dlang.org/post/sjwsaofnanozytrvwxpb@forum.dlang.org
--
More information about the Digitalmars-d-bugs
mailing list