Merging one Array with Another

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 7 14:53:22 PDT 2015


On Thursday, 7 May 2015 at 13:38:23 UTC, Andrea Fontana wrote:
> Because it is a more generic operation and you can work on a 
> lazy range.
> Anyway, to sort and to do uniq it isn't the fastest way.
>
> Or maybe I just didn't understand what you really need. :)

Thanks. These are good ideas in general. I'm curious to why
something like merge isn't already in Phobos. The most similar
existing range in Phobos is probably

http://dlang.org/phobos/std_range.html#roundRobin

I believe MergeRange will be bi-directional right?

Further, I believe minElement and maxElement at

https://github.com/nordlow/justd/blob/master/algorithm_ex.d#L215

should have a CT-specialization in the case when input is a
SortedRange. In that case minElement should return front and
maxElement should return back, right?


More information about the Digitalmars-d-learn mailing list