msgid ""
msgstr ""
"Project-Id-Version: English (Boost Unordered Translation (zh_Hans))\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-06-07 08:25+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: English <https://insights.cppalliance.org/weblate/projects/"
"boost-unordered-documentation-zh_Hans/doc-modules-root-pages-hash-equality-"
"adoc/en/>\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2026.5\n"

#: :3
#, read-only, safe-html, strict-same
msgid ":idprefix: hash_equality_"
msgstr ":idprefix: hash_equality_"

#: :5
#, read-only, safe-html, strict-same
msgid "= Equality Predicates and Hash Functions"
msgstr "= Equality Predicates and Hash Functions"

#: :7
#, read-only, safe-html, strict-same
msgid ""
"While the associative containers use an ordering relation to specify how the "
"elements are stored, the unordered associative containers use an equality "
"predicate and a hash function. For example, `xref:reference/"
"unordered_map.adoc[boost::unordered_map]` is declared as:"
msgstr ""
"While the associative containers use an ordering relation to specify how the "
"elements are stored, the unordered associative containers use an equality "
"predicate and a hash function. For example, `xref:reference/"
"unordered_map.adoc[boost::unordered_map]` is declared as:"

#: :12
#, read-only, safe-html, strict-same
msgid ""
"```cpp template < class Key, class Mapped, class Hash = boost::hash<Key>, "
"class Pred = std::equal_to<Key>, class Alloc = std::allocator<std::pair<Key "
"const, Mapped> > > class unordered_map; ```"
msgstr ""
"```cpp template < class Key, class Mapped, class Hash = boost::hash<Key>, "
"class Pred = std::equal_to<Key>, class Alloc = std::allocator<std::pair<Key "
"const, Mapped> > > class unordered_map; ```"

#: :21
#, read-only, safe-html, strict-same
msgid ""
"The hash function comes first as you might want to change the hash function "
"but not the equality predicate. For example, if you wanted to use the "
"https://en.wikipedia.org/wiki/"
"Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV-1a_hash[FNV-1a hash^] you "
"could write:"
msgstr ""
"The hash function comes first as you might want to change the hash function "
"but not the equality predicate. For example, if you wanted to use the "
"https://en.wikipedia.org/wiki/"
"Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV-1a_hash[FNV-1a hash^] you "
"could write:"

#: :25
#, read-only, safe-html, strict-same
msgid ""
"```cpp boost::unordered_map<std::string, int, hash::fnv_1a> dictionary; ```"
msgstr ""
"```cpp boost::unordered_map<std::string, int, hash::fnv_1a> dictionary; ```"

#: :30
#, read-only, safe-html, strict-same
msgid ""
"There is an link:../../../examples/fnv1.hpp[implementation of FNV-1a^] in "
"the examples directory."
msgstr ""
"There is an link:../../../examples/fnv1.hpp[implementation of FNV-1a^] in "
"the examples directory."

#: :32
#, read-only, safe-html, strict-same
msgid ""
"If you wish to use a different equality function, you will also need to use "
"a matching hash function. For example, to implement a case insensitive "
"dictionary you need to define a case insensitive equality predicate and hash "
"function:"
msgstr ""
"If you wish to use a different equality function, you will also need to use "
"a matching hash function. For example, to implement a case insensitive "
"dictionary you need to define a case insensitive equality predicate and hash "
"function:"

#: :34
#, read-only, safe-html, strict-same
msgid ""
"```cpp struct iequal_to { bool operator()(std::string const& x, std::string "
"const& y) const { return boost::algorithm::iequals(x, y, std::locale()); } };"
msgstr ""
"```cpp struct iequal_to { bool operator()(std::string const& x, std::string "
"const& y) const { return boost::algorithm::iequals(x, y, std::locale()); } };"

#: :44
#, read-only, safe-html, strict-same
msgid ""
"struct ihash { std::size_t operator()(std::string const& x) const { "
"std::size_t seed = 0; std::locale locale;"
msgstr ""
"struct ihash { std::size_t operator()(std::string const& x) const { "
"std::size_t seed = 0; std::locale locale;"

#: :51
#, read-only, safe-html, strict-same
msgid ""
"for(std::string::const_iterator it = x.begin(); it != x.end(); ++it) { "
"boost::hash_combine(seed, std::toupper(*it, locale)); }"
msgstr ""
"for(std::string::const_iterator it = x.begin(); it != x.end(); ++it) { "
"boost::hash_combine(seed, std::toupper(*it, locale)); }"

#: :57
#, read-only, safe-html, strict-same
msgid "return seed; } }; ```"
msgstr "return seed; } }; ```"

#: :62
#, read-only, safe-html, strict-same
msgid ""
"Which you can then use in a case insensitive dictionary: ```cpp "
"boost::unordered_map<std::string, int, ihash, iequal_to> idictionary; ```"
msgstr ""
"Which you can then use in a case insensitive dictionary: ```cpp "
"boost::unordered_map<std::string, int, ihash, iequal_to> idictionary; ```"

#: :68
#, read-only, safe-html, strict-same
msgid ""
"This is a simplified version of the example at link:../../../examples/"
"case_insensitive.hpp[/libs/unordered/examples/case_insensitive.hpp^] which "
"supports other locales and string types."
msgstr ""
"This is a simplified version of the example at link:../../../examples/"
"case_insensitive.hpp[/libs/unordered/examples/case_insensitive.hpp^] which "
"supports other locales and string types."

#: :71
#, read-only, safe-html, strict-same
msgid "Be careful when using the equality (`==`) operator with custom equality"
msgstr "Be careful when using the equality (`==`) operator with custom equality"

#: :72
#, read-only, safe-html, strict-same
msgid ""
"predicates, especially if you're using a function pointer. If you compare "
"two containers with different equality predicates then the result is "
"undefined. For most stateless function objects this is impossible - since "
"you can only compare objects with the same equality predicate you know the "
"equality predicates must be equal. But if you're using function pointers or "
"a stateful equality predicate (e.g. `boost::function`) then you can get into "
"trouble."
msgstr ""
"predicates, especially if you're using a function pointer. If you compare "
"two containers with different equality predicates then the result is "
"undefined. For most stateless function objects this is impossible - since "
"you can only compare objects with the same equality predicate you know the "
"equality predicates must be equal. But if you're using function pointers or "
"a stateful equality predicate (e.g. `boost::function`) then you can get into "
"trouble."

#: :79
#, read-only, safe-html, strict-same
msgid "Custom Types"
msgstr "Custom Types"

#: :81
#, read-only, safe-html, strict-same
msgid "Similarly, a custom hash function can be used for custom types:"
msgstr "Similarly, a custom hash function can be used for custom types:"

#: :83
#, read-only, safe-html, strict-same
msgctxt ":83"
msgid "```cpp struct point { int x; int y; };"
msgstr "```cpp struct point { int x; int y; };"

#: :89
#, read-only, safe-html, strict-same
msgctxt ":89"
msgid ""
"bool operator==(point const& p1, point const& p2) { return p1.x == p2.x && "
"p1.y == p2.y; }"
msgstr ""
"bool operator==(point const& p1, point const& p2) { return p1.x == p2.x && "
"p1.y == p2.y; }"

#: :94
#, read-only, safe-html, strict-same
msgid ""
"struct point_hash { std::size_t operator()(point const& p) const { "
"std::size_t seed = 0; boost::hash_combine(seed, p.x); boost::hash_combine"
"(seed, p.y); return seed; } };"
msgstr ""
"struct point_hash { std::size_t operator()(point const& p) const { "
"std::size_t seed = 0; boost::hash_combine(seed, p.x); boost::hash_combine"
"(seed, p.y); return seed; } };"

#: :105
#, read-only, safe-html, strict-same
msgid "boost::unordered_multiset<point, point_hash> points; ```"
msgstr "boost::unordered_multiset<point, point_hash> points; ```"

#: :108
#, read-only, safe-html, strict-same
msgid ""
"Since the default hash function is link:../../../../container_hash/"
"index.html[Boost.Hash^], we can extend it to support the type so that the "
"hash function doesn't need to be explicitly given:"
msgstr ""
"Since the default hash function is link:../../../../container_hash/"
"index.html[Boost.Hash^], we can extend it to support the type so that the "
"hash function doesn't need to be explicitly given:"

#: :111
#, read-only, safe-html, strict-same
msgctxt ":111"
msgid "```cpp struct point { int x; int y; };"
msgstr "```cpp struct point { int x; int y; };"

#: :117
#, read-only, safe-html, strict-same
msgctxt ":117"
msgid ""
"bool operator==(point const& p1, point const& p2) { return p1.x == p2.x && "
"p1.y == p2.y; }"
msgstr ""
"bool operator==(point const& p1, point const& p2) { return p1.x == p2.x && "
"p1.y == p2.y; }"

#: :122
#, read-only, safe-html, strict-same
msgid ""
"std::size_t hash_value(point const& p) { std::size_t seed = 0; "
"boost::hash_combine(seed, p.x); boost::hash_combine(seed, p.y); return "
"seed; }"
msgstr ""
"std::size_t hash_value(point const& p) { std::size_t seed = 0; "
"boost::hash_combine(seed, p.x); boost::hash_combine(seed, p.y); return "
"seed; }"

#: :130
#, read-only, safe-html, strict-same
msgid "boost::unordered_multiset<point> points; ```"
msgstr "boost::unordered_multiset<point> points; ```"

#: :133
#, read-only, safe-html, strict-same
msgid ""
"See the link:../../../../container_hash/index.html[Boost.Hash "
"documentation^] for more detail on how to do this. Remember that it relies "
"on extensions to the standard - so it won't work for other implementations "
"of the unordered associative containers, you'll need to explicitly use "
"Boost.Hash."
msgstr ""
"See the link:../../../../container_hash/index.html[Boost.Hash "
"documentation^] for more detail on how to do this. Remember that it relies "
"on extensions to the standard - so it won't work for other implementations "
"of the unordered associative containers, you'll need to explicitly use "
"Boost.Hash."

#: :140
#, read-only, safe-html, strict-same
msgid "Method"
msgstr "Method"

#: :140
#, read-only, safe-html, strict-same
msgid "Description"
msgstr "Description"

#: :140
#, read-only, safe-html, strict-same
msgid "`hasher hash_function() const`"
msgstr "`hasher hash_function() const`"

#: :140
#, read-only, safe-html, strict-same
msgid "Returns the container's hash function."
msgstr "Returns the container's hash function."

#: :140
#, read-only, safe-html, strict-same
msgid "`key_equal key_eq() const`"
msgstr "`key_equal key_eq() const`"

#: :140
#, read-only, safe-html, strict-same
msgid "Returns the container's key equality function.."
msgstr "Returns the container's key equality function.."
