hash_multimap::hash_delegate (STL/CLR)

 

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 hash_multimap::hash_delegate (STL/CLR).

Finds an element that matches a specified key.

hasher^ hash_delegate();  

The member function returns the delegate used to convert a key value to an integer. You use it to hash a key.

// cliext_hash_multimap_hash_delegate.cpp   
// compile with: /clr   
#include <cliext/hash_map>   
  
typedef cliext::hash_multimap<wchar_t, int> Myhash_multimap;   
int main()   
    {   
    Myhash_multimap c1;   
    Myhash_multimap::hasher^ myhash = c1.hash_delegate();   
  
    System::Console::WriteLine("hash(L'a') = {0}", myhash(L'a'));   
    System::Console::WriteLine("hash(L'b') = {0}", myhash(L'b'));   
    return (0);   
    }  
  

hash(L'a') = 1616896120  
hash(L'b') = 570892832  

Header: <cliext/hash_map>

Namespace: cliext

hash_multimap (STL/CLR)
hash_multimap::hasher (STL/CLR)

Show: