Bug 18933 – std.range.assumeSorted should not nest SortedRange!(SortedRange!(...), pred)

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-06-01T18:40:27Z
Last change time
2018-06-19T01:27:11Z
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2018-06-01T18:40:27Z
The motivation for fixing this was discovering that repeated application of `std.algorithm.sorting.sort` created new types unnecessarily which was causing a bunch of other templated code to be duplicated. unittest { import std.algorithm.sorting : sort; uint[] a; // The next line currently fails. assert(is(typeof(sort(a)) == typeof(sort(sort(a))))); }
Comment #1 by n8sh.secondary — 2018-06-01T18:51:44Z
Comment #2 by github-bugzilla — 2018-06-19T01:27:10Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/9112e31e501c78e94470d3485484c580192da8fd Fix Issue 18933 - std.range.assumeSorted should not nest SortedRange!(SortedRange!(...), pred) https://github.com/dlang/phobos/commit/653f382afe25852bf65ff0e73df30cac54c138f5 Merge pull request #6535 from n8sh/range-18933 Fix Issue 18933 - std.range.assumeSorted should not nest SortedRange!(SortedRange!(...), pred) merged-on-behalf-of: Sebastian Wilzbach <[email protected]>