Failed to sort range

Sergei Nosov sergei.nosov at gmail.com
Tue May 28 20:58:41 PDT 2013


On Tuesday, 28 May 2013 at 20:43:32 UTC, Ali Çehreli wrote:
> On 05/28/2013 12:47 PM, Anthony Goins wrote:
>
> > sort!("a<b", SwapStrategy.stable)(arr);
> >
> > This worked for me with the code at your link.
>
> I've noticed that too. The reason that works is because in that 
> case it uses Tim Sort. Apparently, the Tim Sort algorithm does 
> not expose the bugs that were in the code.
>
> Ali

I believe the issues with opIndex and opSlice caused the bug. 
Now, those are fixed, and I guess it's safe to say that range 
interface is correct.

Although, I remember a discussion in the NG about somewhat 
"standardized" testing facilities for ranges ( 
http://forum.dlang.org/thread/20130321130858.00003ef4@unknown ). 
Precisely the semantic/runtime behavior, to supplement 
isSomeRange templates family. Do you, guys know, was there any 
activities on it?


More information about the Digitalmars-d-learn mailing list