Partager via


hash_map : : key_type (STL/CLR)

Type d'une clé de classement.

    typedef Key key_type;

Notes

Le type est un synonyme du paramètre de modèle Key.

Exemple

// cliext_hash_map_key_type.cpp 
// compile with: /clr 
#include <cliext/hash_map> 
 
typedef cliext::hash_map<wchar_t, int> Myhash_map; 
int main() 
    { 
    Myhash_map c1; 
    c1.insert(Myhash_map::make_value(L'a', 1)); 
    c1.insert(Myhash_map::make_value(L'b', 2)); 
    c1.insert(Myhash_map::make_value(L'c', 3)); 
 
// display contents " [a 1] [b 2] [c 3]" using key_type 
    for (Myhash_map::iterator it = c1.begin(); it != c1.end(); ++it) 
        {   // store element in key_type object 
        Myhash_map::key_type val = it->first; 
 
        System::Console::Write(" {0}", val); 
        } 
    System::Console::WriteLine(); 
    return (0); 
    } 
 
  

Configuration requise

En-tête : <cliext/hash_map>

Espace de nom : cliext

Voir aussi

Référence

hash_map (STL/CLR)

hash_map : : key_compare (STL/CLR)

hash_map : : mapped_type (STL/CLR)

hash_map : : value_type (STL/CLR)