Aracılığıyla paylaş


hash Class

Computes bir değer kodu karma.

template<class Ty>
    struct hash
        : public unary_function<Ty, size_t> {
    size_t operator()(Ty _Val) const;
    };

Notlar

Üye işlevi türünün değerlerini eşlemek için uygun, karma işlevi tanımlar Ty bir dağıtım dizin değerleri.Üye operatörü için karma kodunu döndürür _Val, şablon sınıfları ile kullanım için uygun unordered_map, unordered_multimap, unordered_set, ve unordered_multiset.Tymay be any scalar type, string, wstring, error_code, error_condition, u16string, or u32string.

Örnek

 

// std_tr1__functional__hash.cpp 
// compile with: /EHsc 
#include <functional> 
#include <iostream> 
#include <unordered_set> 
 
int main() 
    { 
    std::unordered_set<int, std::hash<int> > c0; 
    c0.insert(3); 
    std::cout << *c0.find(3) << std::endl; 
 
    return (0); 
    } 
 
  

Gereksinimler

Başlık: <functional>

Namespace: std

Ayrıca bkz.

Başvuru

<unordered_map>

unordered_multimap Class

unordered_multiset Class

<unordered_set>