Eh, bit faster sort

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 24 08:38:15 PDT 2016


On 09/24/2016 11:13 AM, Andrei Alexandrescu wrote:
> https://github.com/dlang/phobos/pull/4816

Autotester fails with:

std/algorithm/sorting.d(1314): Error: undefined identifier '__dollar'
std/algorithm/sorting.d(1314): Error: undefined identifier '__dollar'
std/algorithm/sorting.d(1715): Error: template instance 
std.algorithm.sorting.shortSort!(binaryFun, RefRange!(int[])) error 
instantiating
std/algorithm/sorting.d(1502):        instantiated from here: 
quickSortImpl!(binaryFun, RefRange!(int[]))
std/range/package.d(9438):        instantiated from here: sort!("a < b", 
cast(SwapStrategy)0, RefRange!(int[]))

It seems RefRange does define length but not opDollar. Could somebody 
fix that?

Also I saw this:

         @property auto length()
         {
             return (*_range).length;
         }

         static if (is(typeof((*cast(const R*)_range).length))) 
@property auto length() const
         {
             return (*_range).length;
         }

What's the deal with that? Surely there are easier ways! Fixes much 
appreciated, thanks!


Andrei



More information about the Digitalmars-d mailing list