CDefaultHashTraits Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CDefaultHashTraits Class.

This class provides a static function for calculating hash values.

template<typename T>  
class CDefaultHashTraits

Parameters

T
The type of data to be stored in the collection.

Public Methods

NameDescription
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();

Parameters

element
The element.

Return Value

Returns the hash value.

Remarks

The default hashing algorithm is very simple: the return value is the element number. Override this function if a more complicated algorithm is required.

Class Overview

Show: