Failed to sort range

Anthony Goins neontotem at gmail.com
Tue May 28 12:47:31 PDT 2013


On Tuesday, 28 May 2013 at 12:57:12 UTC, Sergei Nosov wrote:
> Hi!
>
> I'm trying to implement an array, which uses malloc to allocate 
> memory. Also, I want to implement a random access range 
> interface for it.
>
> That went pretty well, until I tried to sort it. Sorting 
> function asserted "Failed to sort range of type Array!(int)."
>
> I've spent quite some time trying to figure out what's going on 
> with no success.
>
> The implementation can be found at:
> https://gist.github.com/snosov1/5662471
>
> I used
> DMD64 D Compiler v2.062 and
> LDC - the LLVM D compiler (trunk): based on DMD v2.062 and LLVM 
> 3.2svn
> on Ubuntu. Phobos version was the one that came with the dmd 
> compiler.
>
> Does anyone have any ideas what's wrong with the code I've 
> provided?

sort!("a<b", SwapStrategy.stable)(arr);

This worked for me with the code at your link.
Of course it does not answer your real question.
But it is a place to start looking.
(assuming you aren't miles ahead of me already.)


More information about the Digitalmars-d-learn mailing list