This function returns a hashcode on contents of the box. This is useful if boxes are to be used as key-values of containers like std::unordered_map
or HashTable.
Its default implementation creates a hash code using the raw placeholder values and in case of array types over the array memory used.
A templated version that compares the first N-bytes is given with UsePlaceholderBytes. Because the number of bytes to use are given with the template parameter, the method compiles to shortest code. It is registered with all fundamental types.
- Note
- Compatibility header ALib.Boxing.StdFunctors.H specializes functors
std::hash
, std::equal_to
and std::less
for use with containers of the C++ standard library.
- See also
- Method Box::Hashcode, which calls this function.
Definition at line 69 of file functiondecls.inl.