documented P2363 overloads for unordered/unordered_multimap

This commit is contained in:
joaquintides
2022-12-18 11:15:33 +01:00
committed by Christian Mazakas
parent 61aedca940
commit 59d0accce0

View File

@ -111,14 +111,14 @@ namespace boost {
node_type xref:#unordered_multimap_extract_by_iterator[extract](const_iterator position);
node_type xref:#unordered_multimap_extract_by_key[extract](const key_type& k);
template<class K> node_type xref:#unordered_multimap_transparent_extract_by_key[extract](K&& k);
template<class K> node_type xref:#unordered_multimap_extract_by_key[extract](K&& k);
iterator xref:#unordered_multimap_insert_with_node_handle[insert](node_type&& nh);
iterator xref:#unordered_multimap_insert_with_hint_and_node_handle[insert](const_iterator hint, node_type&& nh);
iterator xref:#unordered_multimap_erase_by_position[erase](iterator position);
iterator xref:#unordered_multimap_erase_by_position[erase](const_iterator position);
size_type xref:#unordered_multimap_erase_by_key[erase](const key_type& k);
template<class K> size_type xref:#unordered_multimap_transparent_erase_by_key[erase](K&& k);
template<class K> size_type xref:#unordered_multimap_erase_by_key[erase](K&& k);
iterator xref:#unordered_multimap_erase_range[erase](const_iterator first, const_iterator last);
void xref:#unordered_multimap_quick_erase[quick_erase](const_iterator position);
void xref:#unordered_multimap_erase_return_void[erase_return_void](const_iterator position);
@ -172,6 +172,7 @@ namespace boost {
size_type xref:#unordered_multimap_max_bucket_count[max_bucket_count]() const noexcept;
size_type xref:#unordered_multimap_bucket_size[bucket_size](size_type n) const;
size_type xref:#unordered_multimap_bucket[bucket](const key_type& k) const;
template<class K> size_type xref:#unordered_multimap_bucket[bucket](const K& k) const;
local_iterator xref:#unordered_multimap_begin_2[begin](size_type n);
const_local_iterator xref:#unordered_multimap_begin_2[begin](size_type n) const;
local_iterator xref:#unordered_multimap_end_2[end](size_type n);
@ -964,30 +965,17 @@ Notes:;; A node extracted using this method can be inserted into a compatible `u
==== Extract by Key
```c++
node_type extract(const key_type& k);
```
Removes an element with key equivalent to `k`.
[horizontal]
Returns:;; A `node_type` owning the element if found, otherwise an empty `node_type`.
Throws:;; Only throws an exception if it is thrown by `hasher` or `key_equal`.
Notes:;; A node extracted using this method can be inserted into a compatible `unordered_map`.
---
==== Transparent Extract by Key
```c++
template<class K> node_type extract(K&& k);
```
Removes an element with key equivalent to `k`.
This overload only participates in overload resolution if `Hash::is_transparent` and `Pred::is_transparent` are valid member typedefs and neither `iterator` nor `const_iterator` are implicitly convertible from `K`. The library assumes that `Hash` is callable with both `K` and `Key` and that `Pred` is transparent. This enables heterogeneous lookup which avoids the cost of instantiating an instance of the `Key` type.
[horizontal]
Returns:;; A `node_type` owning the element if found, otherwise an empty `node_type`.
Throws:;; Only throws an exception if it is thrown by `hasher` or `key_equal`.
Notes:;; A node extracted using this method can be inserted into a compatible `unordered_map`.
Notes:;; A node extracted using this method can be inserted into a compatible `unordered_map`. +
+
The `template<class K>` overload only participates in overload resolution if `Hash::is_transparent` and `Pred::is_transparent` are valid member typedefs and neither `iterator` nor `const_iterator` are implicitly convertible from `K`. The library assumes that `Hash` is callable with both `K` and `Key` and that `Pred` is transparent. This enables heterogeneous lookup which avoids the cost of instantiating an instance of the `Key` type.
---
@ -1060,28 +1048,15 @@ Notes:;; In older versions this could be inefficient because it had to search th
==== Erase by Key
```c++
size_type erase(const key_type& k);
```
Erase all elements with key equivalent to `k`.
[horizontal]
Returns:;; The number of elements erased.
Throws:;; Only throws an exception if it is thrown by `hasher` or `key_equal`.
---
==== Transparent Erase by Key
```c++
template<class K> size_type erase(K&& k);
```
Erase all elements with key equivalent to `k`.
This overload only participates in overload resolution if `Hash::is_transparent` and `Pred::is_transparent` are valid member typedefs and neither `iterator` nor `const_iterator` are implicitly convertible from `K`. The library assumes that `Hash` is callable with both `K` and `Key` and that `Pred` is transparent. This enables heterogeneous lookup which avoids the cost of instantiating an instance of the `Key` type.
[horizontal]
Returns:;; The number of elements erased.
Throws:;; Only throws an exception if it is thrown by `hasher` or `key_equal`.
Notes:;; The `template<class K>` overload only participates in overload resolution if `Hash::is_transparent` and `Pred::is_transparent` are valid member typedefs and neither `iterator` nor `const_iterator` are implicitly convertible from `K`. The library assumes that `Hash` is callable with both `K` and `Key` and that `Pred` is transparent. This enables heterogeneous lookup which avoids the cost of instantiating an instance of the `Key` type.
---
@ -1330,11 +1305,13 @@ Returns:;; The number of elements in bucket `n`.
==== bucket
```c++
size_type bucket(const key_type& k) const;
templat<class K> size_type bucket(const K& k) const;
```
[horizontal]
Returns:;; The index of the bucket which would contain an element with key `k`.
Postconditions:;; The return value is less than `bucket_count()`.
Notes:;; The `template<class K>` overload only participates in overload resolution if `Hash::is_transparent` and `Pred::is_transparent` are valid member typedefs. The library assumes that `Hash` is callable with both `K` and `Key` and that `Pred` is transparent. This enables heterogeneous lookup which avoids the cost of instantiating an instance of the `Key` type.
---