hash_t is listed as the output of *some* toHash() functions, without specifying what it is. The type is not defined, but the documentation expects programmers to generate it anyway. size_t is presumably the logical choice.
Since hash_t is being created by programmers, rather than being an opaque type, I don't see where the value in having it is.
Comment #1 by jlquinn — 2009-03-12T00:02:43Z
Additionally, the requirements for user-defined hashing for structs and classes are inconsistent.
First, struct requirements are listed as needing 2 members:
const uint toHash()
const int opCmp(Keytype*)
Later, struct requirements are given again, but this time:
hash_t toHash()
bool opEquals(S) or bool opEquals(S*)
int opCmp(S) or int opCmp(S*)
Classes are supposed to match the 2nd set of functions.
Shouldn't these functions be const? And S should be replaced by "Keytype" or the text above should state that S is a Keytype.
Comment #2 by bugzilla — 2009-03-12T23:56:46Z
The value in hash_t is the self-documenting nature of it. It being called size_t instead implies it contains a value with a different purpose.
But the page does need updating as to the rest of your comments, and I'll fix it.