hash_set::hasher (STL/CLR)

The hashing delegate for a key.

    Microsoft::VisualC::StlClr::UnaryDelegate<GKey, int>
        hasher;

The type describes a delegate that converts a key value to an integer.

// cliext_hash_set_hasher.cpp 
// compile with: /clr 
#include <cliext/hash_set> 
 
typedef cliext::hash_set<wchar_t> Myhash_set; 
int main() 
    { 
    Myhash_set c1; 
    Myhash_set::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_set>

Namespace: cliext

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft