Another fun one: partialSort with two ranges

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 3 17:02:09 PST 2015


On 12/03/2015 06:19 PM, Timon Gehr wrote:
>
> void partialSort(alias less="a<b",R,S)(R r,S s) /+if(...)+/
> { topN!less(chain(r,s),r.length); sort!less(r); }

Again this is suboptimal - should use two ranges, not chain. -- Andrei


More information about the Digitalmars-d mailing list