hash_map::hash_delegate (STL/CLR)

查找与指定键匹配的元素。

hasher^ hash_delegate();

备注

成员函数返回用于转换一个键值为整数的委托。 使用它来哈希一个键。

示例

// cliext_hash_map_hash_delegate.cpp 
// compile with: /clr 
#include <cliext/hash_map> 
 
typedef cliext::hash_map<wchar_t, int> Myhash_map; 
int main() 
    { 
    Myhash_map c1; 
    Myhash_map::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); 
    } 
 
  

要求

标头: <cliext/hash_map>

命名空间: cliext

请参见

参考

hash_map (STL/CLR)

hash_map::hasher (STL/CLR)