topN using a heap

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 23 09:09:18 PDT 2016


On 09/23/2016 11:40 AM, Stefan Koch wrote:
> On Friday, 23 September 2016 at 15:30:20 UTC, Andrei Alexandrescu wrote:
>> Work is blocked by https://issues.dlang.org/show_bug.cgi?id=16528,
>> which is quite a head-scratcher. Any ideas for a workaround? Thanks!
>> -- Andrei
>
> annotate the templates.

I don't want to lose the deduction. I used another workaround (enumerate 
the potential unsafe operations under an if (false) and then forward to 
a @trusted function) in https://github.com/dlang/phobos/pull/4815.

Reviews are welcome!

BTW, as I commented in https://issues.dlang.org/show_bug.cgi?id=16517, 
using the new topN implementation instead of sort to compute the median 
over google's 1-grams is over 11x faster using dmd.


Andrei



More information about the Digitalmars-d mailing list