| title | CDefaultHashTraits Class | |||
|---|---|---|---|---|
| ms.date | 11/04/2016 | |||
| f1_keywords |
|
|||
| helpviewer_keywords |
|
|||
| ms.assetid | d8ec4b37-6d58-447b-a0c1-8580c5b1ab85 |
This class provides a static function for calculating hash values.
template<typename T>
class CDefaultHashTraits
T
The type of data to be stored in the collection.
| Name | Description |
|---|---|
| CDefaultHashTraits::Hash | (Static) Call this function to calculate a hash value for a given element. |
This class contains a single static function that returns a hash value for a given element. This class is utilized by the CDefaultElementTraits Class.
For more information, see ATL Collection Classes.
Header: atlcoll.h
Call this function to calculate a hash value for a given element.
static ULONG Hash(const T& element) throw();
element
The element.
Returns the hash value.
The default hashing algorithm is very simple: the return value is the element number. Override this function if a more complicated algorithm is required.