Why D is annoying =P

Timon Gehr timon.gehr at gmx.ch
Wed Oct 24 14:55:10 PDT 2012


On 10/24/2012 10:16 PM, Mehrdad wrote:
> ...
>
> Maybe you can fill in the blanks?
>
>

import std.stdio;
struct Set(T){
     int[T] dict;
     hash_t toHash() const{
         typeof(return) r = 0;
         foreach(item; this.dict.keys){
             r+=typeid(T).getHash(&item);
         }
         return r;
     }
}



More information about the Digitalmars-d mailing list