www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17679] New: SortedRange.contains should be deprecated in

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 puremagic.com
          Reporter: greensunny12 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

--
Jul 24 2017