在线文档教程
C++
字符串 | Strings

std::hash

std::散列%28std::string[医]视图,STD::wstring[医]视图,std::u16string[医]视图,STD::u32string[医]视图%29

Defined in header
template<> struct hash<std::string_view>; template<> struct hash<std::wstring_view>; template<> struct hash<std::u16string_view>; template<> struct hash<std::u32string_view>;(since C++17)

模板的专门化std::hash用于哈希视图的各种视图类。

These hashes equal the hashes of corresponding std::basic_string classes: If S is one of the standard basic_string types, SV is the corresponding string view type, and s is an object of type S, then std::hash()(s) == std::hash()(SV(s)).(since C++17)

另见

hash (C++11)hash function object (class template)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/string/basic[医]弦[医]视图/散列