Merging one Array with Another
Andrea Fontana via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu May 7 06:38:22 PDT 2015
On Thursday, 7 May 2015 at 09:21:58 UTC, Per Nordlöw wrote:
> On Thursday, 7 May 2015 at 08:03:41 UTC, Andrea Fontana wrote:
>> It's not that difficult to implement.
>> You just need to implement a merge() range that returns the
>> min of all ranges' front(). Then you can define distinct() for
>> SortedRange as:
>>
>> merge(sortedrange1, sortedrange2, sortedrange3).uniq
>>
>> Andrea
>
> Why do you need variadics here? Why the need for sortedrange1,
> sortedrange2 and sortedrange3?
>
> I was only interested in removing equal consequtive elements
> within the same range.
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. :)
More information about the Digitalmars-d-learn
mailing list