Dynamic associative array, to hold many values per key

Logesh Pillay lp at webafrica.org.za
Tue Oct 29 11:02:45 PDT 2013


On Sunday, 20 October 2013 at 16:08:50 UTC, bearophile wrote:
> Logesh Pillay:
>
>> Thanks.  Coming to D from python, I have to say D's tuples 
>> look difficult.  I'm going to see how far I can get with 
>> structs writing my sudoku solver.
>
> I think defining the full correct hashing protocol manually for 
> structs is harder than using tuples.
>
> There were many discussions to improve and simplify D tuples, 
> but nothing has come out of them yet.
>
> Bye,
> bearophile

This thread is dead.  But I'm just posting to say using struct as 
a key to an associative array worked fine without opHash and 
other special methods.  Does that mean (Alexandrescu, ch 4.4.7) 
that the array retrieves slower (The sudoku solver seems fast 
enough though) If so, there is an obvious way to write (x, y) as 
an int: 10x + y


More information about the Digitalmars-d-learn mailing list