I have bounding boxes the key type.
Box {
double mins[2];
double maxs[2];
}
And I want to have Box as the key type in the D programming language, so I have to implement:
size_t toHash() const @safe pure nothrow {
size_t hash;
for(size_t k=0; k < 2; k++) {
// do something here
}
return hash;
}
Should I have a linked list on the output of the associative array and search through the list of there's a collision? Should I find some reasonable bound of double that is in my application then come up with some formula by shifting?
Not sure what to do here.