Takes an argument of an arbitrary type T and calculates the hash
value.
Hash calculation is supported for all scalar types. Aggregate types, like
$(D_KEYWORD struct)s, should implement toHash-function:
size_ttoHash() const
{
returnhash;
}
For pointers and for scalar types implicitly convertible to size_t this
is an identity operation (i.e. the value is cast to size_t and returned
unaltered). Integer types wider than size_t are XOR folded down to
size_t. Other scalar types use an architecture-dependent hash function
based on their width and alignment.
If the type provides a toHash-function, only toHash() is called and its
result is returned.
This function also accepts input ranges that contain hashable elements.
Individual values are combined then and the resulting hash is returned.
Takes an argument of an arbitrary type T and calculates the hash value.
Hash calculation is supported for all scalar types. Aggregate types, like $(D_KEYWORD struct)s, should implement toHash-function:
For pointers and for scalar types implicitly convertible to size_t this is an identity operation (i.e. the value is cast to size_t and returned unaltered). Integer types wider than size_t are XOR folded down to size_t. Other scalar types use an architecture-dependent hash function based on their width and alignment. If the type provides a toHash-function, only toHash() is called and its result is returned.
This function also accepts input ranges that contain hashable elements. Individual values are combined then and the resulting hash is returned.