Re: Exposing pred from SortedRange and changes to algorithms that assumeSorted

2018-01-12 Thread aliak via Digitalmars-d
On Friday, 12 January 2018 at 10:53:04 UTC, Seb wrote: canFind uses find internally, which already has a shortcut for SortedRange. I don't like contains either, but the idea was to have a separate method with different performance guarantees as canFind is typically O(n). Anyways I have tried t

Re: Exposing pred from SortedRange and changes to algorithms that assumeSorted

2018-01-12 Thread Seb via Digitalmars-d
On Friday, 12 January 2018 at 09:52:36 UTC, aliak wrote: Would it be an acceptable enhancement to phobos to expose the predicate in SortedRange (https://dlang.org/library/std/range/sorted_range.html)? The rationale behind it would be so that functions like setDifference (https://dlang.org/li

Exposing pred from SortedRange and changes to algorithms that assumeSorted

2018-01-12 Thread aliak via Digitalmars-d
Would it be an acceptable enhancement to phobos to expose the predicate in SortedRange (https://dlang.org/library/std/range/sorted_range.html)? The rationale behind it would be so that functions like setDifference (https://dlang.org/library/std/algorithm/setops/set_difference.html) or any fun