tmp/tmpohq8smn6/{from.md → to.md}
RENAMED
|
@@ -5,12 +5,12 @@ library provides four basic kinds of associative containers: `set`,
|
|
| 5 |
`multiset`, `map` and `multimap`.
|
| 6 |
|
| 7 |
Each associative container is parameterized on `Key` and an ordering
|
| 8 |
relation `Compare` that induces a strict weak ordering (
|
| 9 |
[[alg.sorting]]) on elements of `Key`. In addition, `map` and `multimap`
|
| 10 |
-
associate an arbitrary type `T` with the `Key`. The object of
|
| 11 |
-
`Compare` is called the *comparison object* of a container.
|
| 12 |
|
| 13 |
The phrase “equivalence of keys” means the equivalence relation imposed
|
| 14 |
by the comparison and *not* the `operator==` on keys. That is, two keys
|
| 15 |
`k1` and `k2` are considered to be equivalent if for the comparison
|
| 16 |
object `comp`, `comp(k1, k2) == false && comp(k2, k1) == false`. For any
|
|
@@ -23,12 +23,11 @@ The `set` and `map` classes support unique keys; the `multiset` and
|
|
| 23 |
`multimap` classes support equivalent keys. For `multiset` and
|
| 24 |
`multimap`, `insert`, `emplace`, and `erase` preserve the relative
|
| 25 |
ordering of equivalent elements.
|
| 26 |
|
| 27 |
For `set` and `multiset` the value type is the same as the key type. For
|
| 28 |
-
`map` and `multimap` it is equal to `pair<const Key, T>`.
|
| 29 |
-
associative container are immutable.
|
| 30 |
|
| 31 |
`iterator`
|
| 32 |
|
| 33 |
of an associative container is of the bidirectional iterator category.
|
| 34 |
For associative containers where the value type is the same as the key
|
|
@@ -49,24 +48,31 @@ associated `value_type`, `pair<const key_type, mapped_type>`, is not
|
|
| 49 |
`CopyAssignable`.
|
| 50 |
|
| 51 |
In Table [[tab:containers.associative.requirements]], `X` denotes an
|
| 52 |
associative container class, `a` denotes a value of `X`, `a_uniq`
|
| 53 |
denotes a value of `X` when `X` supports unique keys, `a_eq` denotes a
|
| 54 |
-
value of `X` when `X` supports multiple keys, `
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
`
|
| 61 |
-
`
|
| 62 |
-
`
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
The `insert` and `emplace` members shall not affect the validity of
|
| 67 |
-
iterators and references to the container, and the erase members shall
|
| 68 |
invalidate only iterators and references to the erased elements.
|
| 69 |
|
| 70 |
The fundamental property of iterators of associative containers is that
|
| 71 |
they iterate through the containers in the non-descending order of keys
|
| 72 |
where non-descending is defined by the comparison that was used to
|
|
@@ -90,10 +96,15 @@ passed object, even if that object is passed by reference. When an
|
|
| 90 |
associative container is copied, either through a copy constructor or an
|
| 91 |
assignment operator, the target container shall then use the comparison
|
| 92 |
object from the container being copied, as if that comparison object had
|
| 93 |
been passed to the target container in its constructor.
|
| 94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
#### Exception safety guarantees <a id="associative.reqmts.except">[[associative.reqmts.except]]</a>
|
| 96 |
|
| 97 |
For associative containers, no `clear()` function throws an exception.
|
| 98 |
`erase(k)` does not throw an exception unless that exception is thrown
|
| 99 |
by the container’s `Compare` object (if any).
|
|
|
|
| 5 |
`multiset`, `map` and `multimap`.
|
| 6 |
|
| 7 |
Each associative container is parameterized on `Key` and an ordering
|
| 8 |
relation `Compare` that induces a strict weak ordering (
|
| 9 |
[[alg.sorting]]) on elements of `Key`. In addition, `map` and `multimap`
|
| 10 |
+
associate an arbitrary *mapped type* `T` with the `Key`. The object of
|
| 11 |
+
type `Compare` is called the *comparison object* of a container.
|
| 12 |
|
| 13 |
The phrase “equivalence of keys” means the equivalence relation imposed
|
| 14 |
by the comparison and *not* the `operator==` on keys. That is, two keys
|
| 15 |
`k1` and `k2` are considered to be equivalent if for the comparison
|
| 16 |
object `comp`, `comp(k1, k2) == false && comp(k2, k1) == false`. For any
|
|
|
|
| 23 |
`multimap` classes support equivalent keys. For `multiset` and
|
| 24 |
`multimap`, `insert`, `emplace`, and `erase` preserve the relative
|
| 25 |
ordering of equivalent elements.
|
| 26 |
|
| 27 |
For `set` and `multiset` the value type is the same as the key type. For
|
| 28 |
+
`map` and `multimap` it is equal to `pair<const Key, T>`.
|
|
|
|
| 29 |
|
| 30 |
`iterator`
|
| 31 |
|
| 32 |
of an associative container is of the bidirectional iterator category.
|
| 33 |
For associative containers where the value type is the same as the key
|
|
|
|
| 48 |
`CopyAssignable`.
|
| 49 |
|
| 50 |
In Table [[tab:containers.associative.requirements]], `X` denotes an
|
| 51 |
associative container class, `a` denotes a value of `X`, `a_uniq`
|
| 52 |
denotes a value of `X` when `X` supports unique keys, `a_eq` denotes a
|
| 53 |
+
value of `X` when `X` supports multiple keys, `a_tran` denotes a value
|
| 54 |
+
of `X` when the qualified-id `X::key_compare::is_transparent` is valid
|
| 55 |
+
and denotes a type ([[temp.deduct]]), `i` and `j` satisfy input
|
| 56 |
+
iterator requirements and refer to elements implicitly convertible to
|
| 57 |
+
`value_type`, \[`i`, `j`) denotes a valid range, `p` denotes a valid
|
| 58 |
+
const iterator to `a`, `q` denotes a valid dereferenceable const
|
| 59 |
+
iterator to `a`, `[q1, q2)` denotes a valid range of const iterators in
|
| 60 |
+
`a`, `il` designates an object of type `initializer_list<value_type>`,
|
| 61 |
+
`t` denotes a value of `X::value_type`, `k` denotes a value of
|
| 62 |
+
`X::key_type` and `c` denotes a value of type `X::key_compare`; `kl` is
|
| 63 |
+
a value such that `a` is partitioned ([[alg.sorting]]) with respect to
|
| 64 |
+
`c(r, kl)`, with `r` the key value of `e` and `e` in `a`; `ku` is a
|
| 65 |
+
value such that `a` is partitioned with respect to `!c(ku, r)`; `ke` is
|
| 66 |
+
a value such that `a` is partitioned with respect to `c(r, ke)` and
|
| 67 |
+
`!c(ke, r)`, with `c(r, ke)` implying `!c(ke, r)`. `A` denotes the
|
| 68 |
+
storage allocator used by `X`, if any, or
|
| 69 |
+
`std::allocator<X::value_type>` otherwise, and `m` denotes an allocator
|
| 70 |
+
of a type convertible to `A`.
|
| 71 |
|
| 72 |
The `insert` and `emplace` members shall not affect the validity of
|
| 73 |
+
iterators and references to the container, and the `erase` members shall
|
| 74 |
invalidate only iterators and references to the erased elements.
|
| 75 |
|
| 76 |
The fundamental property of iterators of associative containers is that
|
| 77 |
they iterate through the containers in the non-descending order of keys
|
| 78 |
where non-descending is defined by the comparison that was used to
|
|
|
|
| 96 |
associative container is copied, either through a copy constructor or an
|
| 97 |
assignment operator, the target container shall then use the comparison
|
| 98 |
object from the container being copied, as if that comparison object had
|
| 99 |
been passed to the target container in its constructor.
|
| 100 |
|
| 101 |
+
The member function templates `find`, `count`, `lower_bound`,
|
| 102 |
+
`upper_bound`, and `equal_range` shall not participate in overload
|
| 103 |
+
resolution unless the qualified-id `Compare::is_transparent` is valid
|
| 104 |
+
and denotes a type ([[temp.deduct]]).
|
| 105 |
+
|
| 106 |
#### Exception safety guarantees <a id="associative.reqmts.except">[[associative.reqmts.except]]</a>
|
| 107 |
|
| 108 |
For associative containers, no `clear()` function throws an exception.
|
| 109 |
`erase(k)` does not throw an exception unless that exception is thrown
|
| 110 |
by the container’s `Compare` object (if any).
|