What wrong did i do? (key in hashtable is always null)

grauzone none at example.net
Thu Dec 31 03:10:12 PST 2009


The Anh Tran wrote:
> This is just a small D exercise. I port c++ knucleotide from 
> shootout.alioth.debian.org
> 
> 
> Issue 1:
> If i manually listing hashtable contents, the key does exist in that ht.
> But (key in hash_table) always yield null.
> Worse, if i use: "auto val = ht[key]", an exception is thrown.
> 
> Problem code is from line 163 to 177.
> 
> 
> Issue 2:
> If I pass an AA (uint[ulong]) to a template function.
> DMD complains that uint[ulong] is void.
> How can i get the type of AA?
> 
> DMD 2.037. Linux Ubuntu.
> Source code:
> ftp://ftp.4utours.com/dualamd/Dlang/knu5.d

Is your opCmp/toHash really called? Maybe the function signature is off, 
and dmd doesn't "find" the function. Just a guess, I don't really know 
how this D2 stuff works.

> Sample data:
> ftp://ftp.4utours.com/dualamd/Dlang/fa50k.txt
> 
> Thanks.


More information about the Digitalmars-d-learn mailing list