msgid ""
msgstr ""
"Project-Id-Version: English (Boost Unordered Translation (zh_Hans))\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-06-07 05:59+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-buckets-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"

#: :2
#, read-only, safe-html, strict-same
msgid ":idprefix: buckets_"
msgstr ":idprefix: buckets_"

#: :4
#, read-only, safe-html, strict-same
msgid "= Basics of Hash Tables"
msgstr "= Basics of Hash Tables"

#: :6
#, read-only, safe-html, strict-same
msgid ""
"The containers are made up of a number of _buckets_, each of which can "
"contain any number of elements. For example, the following diagram shows a "
"`xref:reference/unordered_set.adoc#unordered_set[boost::unordered_set]` with "
"7 buckets containing 5 elements, `A`, `B`, `C`, `D` and `E` (this is just "
"for illustration, containers will typically have more buckets)."
msgstr ""
"The containers are made up of a number of _buckets_, each of which can "
"contain any number of elements. For example, the following diagram shows a "
"`xref:reference/unordered_set.adoc#unordered_set[boost::unordered_set]` with "
"7 buckets containing 5 elements, `A`, `B`, `C`, `D` and `E` (this is just "
"for illustration, containers will typically have more buckets)."

#: :11
#, read-only, safe-html, strict-same
msgid "image::buckets.png[]"
msgstr "image::buckets.png[]"

#: :13
#, read-only, safe-html, strict-same
msgid ""
"In order to decide which bucket to place an element in, the container "
"applies the hash function, `Hash`, to the element's key (for sets the key is "
"the whole element, but is referred to as the key so that the same "
"terminology can be used for sets and maps). This returns a value of type "
"`std::size_t`. `std::size_t` has a much greater range of values then the "
"number of buckets, so the container applies another transformation to that "
"value to choose a bucket to place the element in."
msgstr ""
"In order to decide which bucket to place an element in, the container "
"applies the hash function, `Hash`, to the element's key (for sets the key is "
"the whole element, but is referred to as the key so that the same "
"terminology can be used for sets and maps). This returns a value of type "
"`std::size_t`. `std::size_t` has a much greater range of values then the "
"number of buckets, so the container applies another transformation to that "
"value to choose a bucket to place the element in."

#: :20
#, read-only, safe-html, strict-same
msgid ""
"Retrieving the elements for a given key is simple. The same process is "
"applied to the key to find the correct bucket. Then the key is compared with "
"the elements in the bucket to find any elements that match (using the "
"equality predicate `Pred`). If the hash function has worked well the "
"elements will be evenly distributed amongst the buckets so only a small "
"number of elements will need to be examined."
msgstr ""
"Retrieving the elements for a given key is simple. The same process is "
"applied to the key to find the correct bucket. Then the key is compared with "
"the elements in the bucket to find any elements that match (using the "
"equality predicate `Pred`). If the hash function has worked well the "
"elements will be evenly distributed amongst the buckets so only a small "
"number of elements will need to be examined."

#: :27
#, read-only, safe-html, strict-same
msgid ""
"There is xref:hash_equality.adoc#hash_equality[more information on hash "
"functions and equality predicates in the next section]."
msgstr ""
"There is xref:hash_equality.adoc#hash_equality[more information on hash "
"functions and equality predicates in the next section]."

#: :30
#, read-only, safe-html, strict-same
msgid ""
"You can see in the diagram that `A` & `D` have been placed in the same "
"bucket. When looking for elements in this bucket up to 2 comparisons are "
"made, making the search slower. This is known as a *collision*. To keep "
"things fast we try to keep collisions to a minimum."
msgstr ""
"You can see in the diagram that `A` & `D` have been placed in the same "
"bucket. When looking for elements in this bucket up to 2 comparisons are "
"made, making the search slower. This is known as a *collision*. To keep "
"things fast we try to keep collisions to a minimum."

#: :35
#, read-only, safe-html, strict-same
msgid ""
"If instead of `boost::unordered_set` we had used `xref:reference/"
"unordered_flat_set.adoc[boost::unordered_flat_set]`, the diagram would look "
"as follows:"
msgstr ""
"If instead of `boost::unordered_set` we had used `xref:reference/"
"unordered_flat_set.adoc[boost::unordered_flat_set]`, the diagram would look "
"as follows:"

#: :38
#, read-only, safe-html, strict-same
msgid "image::buckets-oa.png[]"
msgstr "image::buckets-oa.png[]"

#: :40
#, read-only, safe-html, strict-same
msgid ""
"In open-addressing containers, buckets can hold at most one element; if a "
"collision happens (like is the case of `D` in the example), the element uses "
"some other available bucket in the vicinity of the original position. Given "
"this simpler scenario, Boost.Unordered open-addressing containers offer a "
"very limited API for accessing buckets."
msgstr ""
"In open-addressing containers, buckets can hold at most one element; if a "
"collision happens (like is the case of `D` in the example), the element uses "
"some other available bucket in the vicinity of the original position. Given "
"this simpler scenario, Boost.Unordered open-addressing containers offer a "
"very limited API for accessing buckets."

#: :48
#, read-only, safe-html, strict-same
msgctxt ":48"
msgid "2+^h| *All containers* h|*Method* h|*Description*"
msgstr "2+^h| *All containers* h|*Method* h|*Description*"

#: :51
#, read-only, safe-html, strict-same
msgid "`size_type bucket_count() const`"
msgstr "`size_type bucket_count() const`"

#: :51
#, read-only, safe-html, strict-same
msgid "The number of buckets."
msgstr "The number of buckets."

#: :54
#, read-only, safe-html, strict-same
msgid "2+^h| *Closed-addressing containers only* h|*Method* h|*Description*"
msgstr "2+^h| *Closed-addressing containers only* h|*Method* h|*Description*"

#: :57
#, read-only, safe-html, strict-same
msgid "`size_type max_bucket_count() const`"
msgstr "`size_type max_bucket_count() const`"

#: :57
#, read-only, safe-html, strict-same
msgid "An upper bound on the number of buckets."
msgstr "An upper bound on the number of buckets."

#: :57
#, read-only, safe-html, strict-same
msgid "`size_type bucket_size(size_type n) const`"
msgstr "`size_type bucket_size(size_type n) const`"

#: :57
#, read-only, safe-html, strict-same
msgid "The number of elements in bucket `n`."
msgstr "The number of elements in bucket `n`."

#: :57
#, read-only, safe-html, strict-same
msgid "`size_type bucket(key_type const& k) const`"
msgstr "`size_type bucket(key_type const& k) const`"

#: :57
#, read-only, safe-html, strict-same
msgid "Returns the index of the bucket which would contain `k`."
msgstr "Returns the index of the bucket which would contain `k`."

#: :57
#, read-only, safe-html, strict-same
msgid "`local_iterator begin(size_type n)`"
msgstr "`local_iterator begin(size_type n)`"

#: :66
#, read-only, safe-html, strict-same
msgid "1.6+|Return begin and end iterators for bucket `n`."
msgstr "1.6+|Return begin and end iterators for bucket `n`."

#: :68
#, read-only, safe-html, strict-same
msgid "`local_iterator end(size_type n)`"
msgstr "`local_iterator end(size_type n)`"

#: :68
#, read-only, safe-html, strict-same
msgid "`const_local_iterator begin(size_type n) const`"
msgstr "`const_local_iterator begin(size_type n) const`"

#: :68
#, read-only, safe-html, strict-same
msgid "`const_local_iterator end(size_type n) const`"
msgstr "`const_local_iterator end(size_type n) const`"

#: :68
#, read-only, safe-html, strict-same
msgid "`const_local_iterator cbegin(size_type n) const`"
msgstr "`const_local_iterator cbegin(size_type n) const`"

#: :68
#, read-only, safe-html, strict-same
msgid "`const_local_iterator cend(size_type n) const`"
msgstr "`const_local_iterator cend(size_type n) const`"

#: :80
#, read-only, safe-html, strict-same
msgid "Controlling the Number of Buckets"
msgstr "Controlling the Number of Buckets"

#: :82
#, read-only, safe-html, strict-same
msgid ""
"As more elements are added to an unordered associative container, the number "
"of collisions will increase causing performance to degrade. To combat this "
"the containers increase the bucket count as elements are inserted. You can "
"also tell the container to change the bucket count (if required) by calling "
"`rehash`."
msgstr ""
"As more elements are added to an unordered associative container, the number "
"of collisions will increase causing performance to degrade. To combat this "
"the containers increase the bucket count as elements are inserted. You can "
"also tell the container to change the bucket count (if required) by calling "
"`rehash`."

#: :88
#, read-only, safe-html, strict-same
msgid ""
"The standard leaves a lot of freedom to the implementer to decide how the "
"number of buckets is chosen, but it does make some requirements based on the "
"container's _load factor_, the number of elements divided by the number of "
"buckets. Containers also have a _maximum load factor_ which they should try "
"to keep the load factor below."
msgstr ""
"The standard leaves a lot of freedom to the implementer to decide how the "
"number of buckets is chosen, but it does make some requirements based on the "
"container's _load factor_, the number of elements divided by the number of "
"buckets. Containers also have a _maximum load factor_ which they should try "
"to keep the load factor below."

#: :94
#, read-only, safe-html, strict-same
msgid ""
"You can't control the bucket count directly but there are two ways to "
"influence it:"
msgstr ""
"You can't control the bucket count directly but there are two ways to "
"influence it:"

#: :97
#, read-only, safe-html, strict-same
msgid ""
"Specify the minimum number of buckets when constructing a container or when "
"calling `rehash`."
msgstr ""
"Specify the minimum number of buckets when constructing a container or when "
"calling `rehash`."

#: :98
#, read-only, safe-html, strict-same
msgid "Suggest a maximum load factor by calling `max_load_factor`."
msgstr "Suggest a maximum load factor by calling `max_load_factor`."

#: :100
#, read-only, safe-html, strict-same
msgid ""
"`max_load_factor` doesn't let you set the maximum load factor yourself, it "
"just lets you give a _hint_. And even then, the standard doesn't actually "
"require the container to pay much attention to this value. The only time the "
"load factor is _required_ to be less than the maximum is following a call to "
"`rehash`. But most implementations will try to keep the number of elements "
"below the max load factor, and set the maximum load factor to be the same as "
"or close to the hint - unless your hint is unreasonably small or large."
msgstr ""
"`max_load_factor` doesn't let you set the maximum load factor yourself, it "
"just lets you give a _hint_. And even then, the standard doesn't actually "
"require the container to pay much attention to this value. The only time the "
"load factor is _required_ to be less than the maximum is following a call to "
"`rehash`. But most implementations will try to keep the number of elements "
"below the max load factor, and set the maximum load factor to be the same as "
"or close to the hint - unless your hint is unreasonably small or large."

#: :111
#, read-only, safe-html, strict-same
msgctxt ":111"
msgid "2+^h| *All containers* h|*Method* h|*Description*"
msgstr "2+^h| *All containers* h|*Method* h|*Description*"

#: :114
#, read-only, safe-html, strict-same
msgid "`X(size_type n)`"
msgstr "`X(size_type n)`"

#: :114
#, read-only, safe-html, strict-same
msgid ""
"Construct an empty container with at least `n` buckets (`X` is the container "
"type)."
msgstr ""
"Construct an empty container with at least `n` buckets (`X` is the container "
"type)."

#: :114
#, read-only, safe-html, strict-same
msgid "`X(InputIterator i, InputIterator j, size_type n)`"
msgstr "`X(InputIterator i, InputIterator j, size_type n)`"

#: :114
#, read-only, safe-html, strict-same
msgid ""
"Construct an empty container with at least `n` buckets and insert elements "
"from the range `[i, j)` (`X` is the container type)."
msgstr ""
"Construct an empty container with at least `n` buckets and insert elements "
"from the range `[i, j)` (`X` is the container type)."

#: :114
#, read-only, safe-html, strict-same
msgid "`float load_factor() const`"
msgstr "`float load_factor() const`"

#: :114
#, read-only, safe-html, strict-same
msgid "The average number of elements per bucket."
msgstr "The average number of elements per bucket."

#: :114
#, read-only, safe-html, strict-same
msgid "`float max_load_factor() const`"
msgstr "`float max_load_factor() const`"

#: :114
#, read-only, safe-html, strict-same
msgid "Returns the current maximum load factor."
msgstr "Returns the current maximum load factor."

#: :114
#, read-only, safe-html, strict-same
msgid "`float max_load_factor(float z)`"
msgstr "`float max_load_factor(float z)`"

#: :114
#, read-only, safe-html, strict-same
msgid "Changes the container's maximum load factor, using `z` as a hint. +"
msgstr "Changes the container's maximum load factor, using `z` as a hint. +"

#: :128
#, read-only, safe-html, strict-same
msgid ""
"**Open-addressing and concurrent containers:** this function does nothing: "
"users are not allowed to change the maximum load factor."
msgstr ""
"**Open-addressing and concurrent containers:** this function does nothing: "
"users are not allowed to change the maximum load factor."

#: :130
#, read-only, safe-html, strict-same
msgid "`void rehash(size_type n)`"
msgstr "`void rehash(size_type n)`"

#: :130
#, read-only, safe-html, strict-same
msgid ""
"Changes the number of buckets so that there at least `n` buckets, and so "
"that the load factor is less than the maximum load factor."
msgstr ""
"Changes the number of buckets so that there at least `n` buckets, and so "
"that the load factor is less than the maximum load factor."

#: :133
#, read-only, safe-html, strict-same
msgid ""
"2+^h| *Open-addressing and concurrent containers only* h|*Method* "
"h|*Description*"
msgstr ""
"2+^h| *Open-addressing and concurrent containers only* h|*Method* "
"h|*Description*"

#: :136
#, read-only, safe-html, strict-same
msgid "`size_type max_load() const`"
msgstr "`size_type max_load() const`"

#: :136
#, read-only, safe-html, strict-same
msgid ""
"Returns the maximum number of allowed elements in the container before "
"rehash."
msgstr ""
"Returns the maximum number of allowed elements in the container before "
"rehash."

#: :141
#, read-only, safe-html, strict-same
msgid ""
"A note on `max_load` for open-addressing and concurrent containers: the "
"maximum load will be (`max_load_factor() * bucket_count()`) right after "
"`rehash` or on container creation, but may slightly decrease when erasing "
"elements in high-load situations. For instance, if we have a `xref:reference/"
"unordered_flat_map.adoc#unordered_flat_map[boost::unordered_flat_map]` with "
"`size()` almost at `max_load()` level and then erase 1,000 elements, "
"`max_load()` may decrease by around a few dozen elements. This is done "
"internally by Boost.Unordered in order to keep its performance stable, and "
"must be taken into account when planning for rehash-free insertions."
msgstr ""
"A note on `max_load` for open-addressing and concurrent containers: the "
"maximum load will be (`max_load_factor() * bucket_count()`) right after "
"`rehash` or on container creation, but may slightly decrease when erasing "
"elements in high-load situations. For instance, if we have a `xref:reference/"
"unordered_flat_map.adoc#unordered_flat_map[boost::unordered_flat_map]` with "
"`size()` almost at `max_load()` level and then erase 1,000 elements, "
"`max_load()` may decrease by around a few dozen elements. This is done "
"internally by Boost.Unordered in order to keep its performance stable, and "
"must be taken into account when planning for rehash-free insertions."
