www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18933] New: std.range.assumeSorted should not nest

https://issues.dlang.org/show_bug.cgi?id=18933

          Issue ID: 18933
           Summary: std.range.assumeSorted should not nest
                    SortedRange!(SortedRange!(...), pred)
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: n8sh.secondary hotmail.com

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)))));
}

--
Jun 01 2018