My experience making an on-disk merge sort using ranges

Chris Cain clcain at uncg.edu
Tue Feb 26 23:05:28 PST 2013


On Wednesday, 27 February 2013 at 04:21:41 UTC, Andrei 
Alexandrescu wrote:
>
> In all likelihood these are manifestations of simple bugs. 
> Please submit all cases that should work but are failing (in 
> the same bug report) and we'll get them fixed.
>

It's honestly a bit scary opening my first bug report here. I 
wasn't sure if it was just something that I'm overlooking about 
the behavior. However, I've investigated a bit further and I can 
see that it only applies to ByLine (a string[][], for instance, 
works). I put that additional knowledge into the bug report:

http://d.puremagic.com/issues/show_bug.cgi?id=9598

> Thanks for your work! nWayUnion is a pretty darn slick 
> algorithm.

Thank you too. I was about to write my own range-based solution 
to solve this problem and just happened across nWayUnion while I 
was looking for useful components. I was close to coding my own 
solution (using the heap from std.container, no less) and found 
out that my solution was already written. I've run across many 
such gems in the standard library and it never ceases to amaze me 
just how flexible, effective, and (usually) fast everything is.


More information about the Digitalmars-d mailing list