From Jason Turner

[unord.req]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpxtfe66g0/{from.md → to.md} +43 -33
tmp/tmpxtfe66g0/{from.md → to.md} RENAMED
@@ -89,17 +89,17 @@ In this subclause,
89
  - `a_tran` denotes a value of type `X` or `const X` when the
90
  *qualified-id*s `X::key_equal::is_transparent` and
91
  `X::hasher::is_transparent` are both valid and denote types
92
  [[temp.deduct]],
93
  - `i` and `j` denote input iterators that refer to `value_type`,
94
- - `[i, j)` denotes a valid range,
95
  - `rg` denotes a value of a type `R` that models
96
  `container-compatible-range<value_type>`,
97
  - `p` and `q2` denote valid constant iterators to `a`,
98
  - `q` and `q1` denote valid dereferenceable constant iterators to `a`,
99
  - `r` denotes a valid dereferenceable iterator to `a`,
100
- - `[q1, q2)` denotes a valid range in `a`,
101
  - `il` denotes a value of type `initializer_list<value_type>`,
102
  - `t` denotes a value of type `X::value_type`,
103
  - `k` denotes a value of type `key_type`,
104
  - `hf` denotes a value of type `hasher` or `const hasher`,
105
  - `eq` denotes a value of type `key_equal` or `const key_equal`,
@@ -122,19 +122,19 @@ In this subclause,
122
  - `z` denotes a value of type `float`, and
123
  - `nh` denotes an rvalue of type `X::node_type`.
124
 
125
  A type `X` meets the *unordered associative container* requirements if
126
  `X` meets all the requirements of an allocator-aware container
127
- [[container.requirements.general]] and the following types, statements,
128
- and expressions are well-formed and have the specified semantics, except
129
  that for `unordered_map` and `unordered_multimap`, the requirements
130
- placed on `value_type` in [[container.alloc.reqmts]] apply instead to
131
  `key_type` and `mapped_type`.
132
 
133
- [*Note 3*: For example, `key_type` and `mapped_type` are sometimes
134
- required to be *Cpp17CopyAssignable* even though the associated
135
- `value_type`, `pair<const key_type, mapped_type>`, is not
136
  *Cpp17CopyAssignable*. — *end note*]
137
 
138
  ``` cpp
139
  typename X::key_type
140
  ```
@@ -401,12 +401,12 @@ X(il, n, hf, eq)
401
  ``` cpp
402
  X(b)
403
  ```
404
 
405
  *Effects:* In addition to the container
406
- requirements [[container.requirements.general]], copies the hash
407
- function, predicate, and maximum load factor.
408
 
409
  *Complexity:* Average case linear in `b.size()`, worst case quadratic.
410
 
411
  ``` cpp
412
  a = b
@@ -492,21 +492,15 @@ from `args`.
492
  a.emplace_hint(p, args)
493
  ```
494
 
495
  *Result:* `iterator`
496
 
497
- *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into `X`
498
- from `args`.
 
499
 
500
- *Effects:* Equivalent to `a.emplace(std::forward<Args>(args)...)`.
501
-
502
- *Returns:* An iterator pointing to the element with the key equivalent
503
- to the newly inserted element. The `const_iterator` `p` is a hint
504
- pointing to where the search should start. Implementations are permitted
505
- to ignore the hint.
506
-
507
- *Complexity:* Average case 𝑂(1), worst case 𝑂(`a.size()`).
508
 
509
  ``` cpp
510
  a_uniq.insert(t)
511
  ```
512
 
@@ -567,11 +561,11 @@ a.insert(i, j)
567
  *Result:* `void`
568
 
569
  *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into `X`
570
  from `*i`. Neither `i` nor `j` are iterators into `a`.
571
 
572
- *Effects:* Equivalent to `a.insert(t)` for each element in `[i,j)`.
573
 
574
  *Complexity:* Average case 𝑂(N), where N is `distance(i, j)`, worst case
575
  𝑂(N(`a.size()` + 1)).
576
 
577
  ``` cpp
@@ -773,11 +767,11 @@ a.erase(r)
773
  a.erase(q1, q2)
774
  ```
775
 
776
  *Result:* `iterator`
777
 
778
- *Effects:* Erases all elements in the range `[q1, q2)`.
779
 
780
  *Returns:* The iterator immediately following the erased elements prior
781
  to the erasure.
782
 
783
  *Complexity:* Average case linear in `distance(q1, q2)`, worst case
@@ -905,21 +899,37 @@ b.bucket(k)
905
 
906
  *Preconditions:* `b.bucket_count() > 0`.
907
 
908
  *Returns:* The index of the bucket in which elements with keys
909
  equivalent to `k` would be found, if any such element existed. The
910
- return value is in the range `[0, b.bucket_count())`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
911
 
912
  *Complexity:* Constant.
913
 
914
  ``` cpp
915
  b.bucket_size(n)
916
  ```
917
 
918
  *Result:* `size_type`
919
 
920
- *Preconditions:* `n` shall be in the range `[0, b.bucket_count())`.
921
 
922
  *Returns:* The number of elements in the `n`ᵗʰ bucket.
923
 
924
  *Complexity:* 𝑂(`b.bucket_size(n)`)
925
 
@@ -927,11 +937,11 @@ b.bucket_size(n)
927
  b.begin(n)
928
  ```
929
 
930
  *Result:* `local_iterator`; `const_local_iterator` for constant `b`.
931
 
932
- *Preconditions:* `n` is in the range `[0, b.bucket_count())`.
933
 
934
  *Returns:* An iterator referring to the first element in the bucket. If
935
  the bucket is empty, then `b.begin(n) == b.end(n)`.
936
 
937
  *Complexity:* Constant.
@@ -940,11 +950,11 @@ the bucket is empty, then `b.begin(n) == b.end(n)`.
940
  b.end(n)
941
  ```
942
 
943
  *Result:* `local_iterator`; `const_local_iterator` for constant `b`.
944
 
945
- *Preconditions:* `n` is in the range `[0, b.bucket_count())`.
946
 
947
  *Returns:* An iterator which is the past-the-end value for the bucket.
948
 
949
  *Complexity:* Constant.
950
 
@@ -952,11 +962,11 @@ b.end(n)
952
  b.cbegin(n)
953
  ```
954
 
955
  *Result:* `const_local_iterator`
956
 
957
- *Preconditions:* `n` shall be in the range `[0, b.bucket_count())`.
958
 
959
  *Returns:* An iterator referring to the first element in the bucket. If
960
  the bucket is empty, then `b.cbegin(n) == b.cend(n)`.
961
 
962
  *Complexity:* Constant.
@@ -965,11 +975,11 @@ the bucket is empty, then `b.cbegin(n) == b.cend(n)`.
965
  b.cend(n)
966
  ```
967
 
968
  *Result:* `const_local_iterator`
969
 
970
- *Preconditions:* `n` is in the range `[0, b.bucket_count())`.
971
 
972
  *Returns:* An iterator which is the past-the-end value for the bucket.
973
 
974
  *Complexity:* Constant.
975
 
@@ -1074,15 +1084,15 @@ accessing the element through such pointers and references while the
1074
  element is owned by a `node_type` is undefined behavior. References and
1075
  pointers to an element obtained while it is owned by a `node_type` are
1076
  invalidated if the element is successfully inserted.
1077
 
1078
  The member function templates `find`, `count`, `equal_range`,
1079
- `contains`, `extract`, and `erase` shall not participate in overload
1080
- resolution unless the *qualified-id*s `Pred::is_transparent` and
1081
- `Hash::is_transparent` are both valid and denote types [[temp.deduct]].
1082
- Additionally, the member function templates `extract` and `erase` shall
1083
- not participate in overload resolution if
1084
  `is_convertible_v<K&&, iterator> || is_convertible_v<K&&, const_iterator>`
1085
  is `true`, where `K` is the type substituted as the first template
1086
  argument.
1087
 
1088
  A deduction guide for an unordered associative container shall not
 
89
  - `a_tran` denotes a value of type `X` or `const X` when the
90
  *qualified-id*s `X::key_equal::is_transparent` and
91
  `X::hasher::is_transparent` are both valid and denote types
92
  [[temp.deduct]],
93
  - `i` and `j` denote input iterators that refer to `value_type`,
94
+ - \[`i`, `j`) denotes a valid range,
95
  - `rg` denotes a value of a type `R` that models
96
  `container-compatible-range<value_type>`,
97
  - `p` and `q2` denote valid constant iterators to `a`,
98
  - `q` and `q1` denote valid dereferenceable constant iterators to `a`,
99
  - `r` denotes a valid dereferenceable iterator to `a`,
100
+ - \[`q1`, `q2`) denotes a valid range in `a`,
101
  - `il` denotes a value of type `initializer_list<value_type>`,
102
  - `t` denotes a value of type `X::value_type`,
103
  - `k` denotes a value of type `key_type`,
104
  - `hf` denotes a value of type `hasher` or `const hasher`,
105
  - `eq` denotes a value of type `key_equal` or `const key_equal`,
 
122
  - `z` denotes a value of type `float`, and
123
  - `nh` denotes an rvalue of type `X::node_type`.
124
 
125
  A type `X` meets the *unordered associative container* requirements if
126
  `X` meets all the requirements of an allocator-aware container
127
+ [[container.alloc.reqmts]] and the following types, statements, and
128
+ expressions are well-formed and have the specified semantics, except
129
  that for `unordered_map` and `unordered_multimap`, the requirements
130
+ placed on `value_type` in [[container.reqmts]] apply instead to
131
  `key_type` and `mapped_type`.
132
 
133
+ [*Note 3*: For example, `key_type` and `mapped_type` sometimes need to
134
+ be *Cpp17CopyAssignable* even though the associated `value_type`,
135
+ `pair<const key_type, mapped_type>`, is not
136
  *Cpp17CopyAssignable*. — *end note*]
137
 
138
  ``` cpp
139
  typename X::key_type
140
  ```
 
401
  ``` cpp
402
  X(b)
403
  ```
404
 
405
  *Effects:* In addition to the container
406
+ requirements [[container.reqmts]], copies the hash function, predicate,
407
+ and maximum load factor.
408
 
409
  *Complexity:* Average case linear in `b.size()`, worst case quadratic.
410
 
411
  ``` cpp
412
  a = b
 
492
  a.emplace_hint(p, args)
493
  ```
494
 
495
  *Result:* `iterator`
496
 
497
+ *Effects:* Equivalent to `a.emplace(std::forward<Args>(args)...)`,
498
+ except that the `const_iterator` `p` is a hint pointing to where the
499
+ search should start. Implementations are permitted to ignore the hint.
500
 
501
+ *Returns:* The iterator returned by `emplace`.
 
 
 
 
 
 
 
502
 
503
  ``` cpp
504
  a_uniq.insert(t)
505
  ```
506
 
 
561
  *Result:* `void`
562
 
563
  *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into `X`
564
  from `*i`. Neither `i` nor `j` are iterators into `a`.
565
 
566
+ *Effects:* Equivalent to `a.insert(t)` for each element in \[`i`, `j`).
567
 
568
  *Complexity:* Average case 𝑂(N), where N is `distance(i, j)`, worst case
569
  𝑂(N(`a.size()` + 1)).
570
 
571
  ``` cpp
 
767
  a.erase(q1, q2)
768
  ```
769
 
770
  *Result:* `iterator`
771
 
772
+ *Effects:* Erases all elements in the range \[`q1`, `q2`).
773
 
774
  *Returns:* The iterator immediately following the erased elements prior
775
  to the erasure.
776
 
777
  *Complexity:* Average case linear in `distance(q1, q2)`, worst case
 
899
 
900
  *Preconditions:* `b.bucket_count() > 0`.
901
 
902
  *Returns:* The index of the bucket in which elements with keys
903
  equivalent to `k` would be found, if any such element existed. The
904
+ return value is in the range \[`0`, `b.bucket_count()`).
905
+
906
+ *Complexity:* Constant.
907
+
908
+ ``` cpp
909
+ a_tran.bucket(ke)
910
+ ```
911
+
912
+ *Result:* `size_type`
913
+
914
+ *Preconditions:* `a_tran.bucket_count() > 0`.
915
+
916
+ *Ensures:* The return value is in the range \[`0`,
917
+ `a_tran.bucket_count()`).
918
+
919
+ *Returns:* The index of the bucket in which elements with keys
920
+ equivalent to `ke` would be found, if any such element existed.
921
 
922
  *Complexity:* Constant.
923
 
924
  ``` cpp
925
  b.bucket_size(n)
926
  ```
927
 
928
  *Result:* `size_type`
929
 
930
+ *Preconditions:* `n` shall be in the range \[`0`, `b.bucket_count()`).
931
 
932
  *Returns:* The number of elements in the `n`ᵗʰ bucket.
933
 
934
  *Complexity:* 𝑂(`b.bucket_size(n)`)
935
 
 
937
  b.begin(n)
938
  ```
939
 
940
  *Result:* `local_iterator`; `const_local_iterator` for constant `b`.
941
 
942
+ *Preconditions:* `n` is in the range \[`0`, `b.bucket_count()`).
943
 
944
  *Returns:* An iterator referring to the first element in the bucket. If
945
  the bucket is empty, then `b.begin(n) == b.end(n)`.
946
 
947
  *Complexity:* Constant.
 
950
  b.end(n)
951
  ```
952
 
953
  *Result:* `local_iterator`; `const_local_iterator` for constant `b`.
954
 
955
+ *Preconditions:* `n` is in the range \[`0`, `b.bucket_count()`).
956
 
957
  *Returns:* An iterator which is the past-the-end value for the bucket.
958
 
959
  *Complexity:* Constant.
960
 
 
962
  b.cbegin(n)
963
  ```
964
 
965
  *Result:* `const_local_iterator`
966
 
967
+ *Preconditions:* `n` shall be in the range \[`0`, `b.bucket_count()`).
968
 
969
  *Returns:* An iterator referring to the first element in the bucket. If
970
  the bucket is empty, then `b.cbegin(n) == b.cend(n)`.
971
 
972
  *Complexity:* Constant.
 
975
  b.cend(n)
976
  ```
977
 
978
  *Result:* `const_local_iterator`
979
 
980
+ *Preconditions:* `n` is in the range \[`0`, `b.bucket_count()`).
981
 
982
  *Returns:* An iterator which is the past-the-end value for the bucket.
983
 
984
  *Complexity:* Constant.
985
 
 
1084
  element is owned by a `node_type` is undefined behavior. References and
1085
  pointers to an element obtained while it is owned by a `node_type` are
1086
  invalidated if the element is successfully inserted.
1087
 
1088
  The member function templates `find`, `count`, `equal_range`,
1089
+ `contains`, `extract`, `erase`, and `bucket` shall not participate in
1090
+ overload resolution unless the *qualified-id*s `Pred::is_transparent`
1091
+ and `Hash::is_transparent` are both valid and denote types
1092
+ [[temp.deduct]]. Additionally, the member function templates `extract`
1093
+ and `erase` shall not participate in overload resolution if
1094
  `is_convertible_v<K&&, iterator> || is_convertible_v<K&&, const_iterator>`
1095
  is `true`, where `K` is the type substituted as the first template
1096
  argument.
1097
 
1098
  A deduction guide for an unordered associative container shall not