tmp/tmp7w8nb6h9/{from.md → to.md}
RENAMED
|
@@ -52,14 +52,14 @@ In this subclause,
|
|
| 52 |
|
| 53 |
- `X` denotes an associative container class,
|
| 54 |
- `a` denotes a value of type `X`,
|
| 55 |
- `a2` denotes a value of a type with nodes compatible with type `X` (
|
| 56 |
[[container.node.compat]]),
|
| 57 |
-
- `b` denotes a value
|
| 58 |
- `u` denotes the name of a variable being declared,
|
| 59 |
- `a_uniq` denotes a value of type `X` when `X` supports unique keys,
|
| 60 |
-
- `a_eq` denotes a value of type `X` when `X` supports
|
| 61 |
- `a_tran` denotes a value of type `X` or `const X` when the
|
| 62 |
*qualified-id* `X::key_compare::is_transparent` is valid and denotes a
|
| 63 |
type [[temp.deduct]],
|
| 64 |
- `i` and `j` meet the *Cpp17InputIterator* requirements and refer to
|
| 65 |
elements implicitly convertible to `value_type`,
|
|
@@ -67,11 +67,11 @@ In this subclause,
|
|
| 67 |
- `rg` denotes a value of a type `R` that models
|
| 68 |
`container-compatible-range<value_type>`,
|
| 69 |
- `p` denotes a valid constant iterator to `a`,
|
| 70 |
- `q` denotes a valid dereferenceable constant iterator to `a`,
|
| 71 |
- `r` denotes a valid dereferenceable iterator to `a`,
|
| 72 |
-
-
|
| 73 |
- `il` designates an object of type `initializer_list<value_type>`,
|
| 74 |
- `t` denotes a value of type `X::value_type`,
|
| 75 |
- `k` denotes a value of type `X::key_type`, and
|
| 76 |
- `c` denotes a value of type `X::key_compare` or
|
| 77 |
`const X::key_compare`;
|
|
@@ -93,19 +93,18 @@ In this subclause,
|
|
| 93 |
- `m` denotes an allocator of a type convertible to `A`, and `nh`
|
| 94 |
denotes a non-const rvalue of type `X::node_type`.
|
| 95 |
|
| 96 |
A type `X` meets the *associative container* requirements if `X` meets
|
| 97 |
all the requirements of an allocator-aware container
|
| 98 |
-
[[container.
|
| 99 |
-
|
| 100 |
that for `map` and `multimap`, the requirements placed on `value_type`
|
| 101 |
-
in [[container.
|
| 102 |
-
`mapped_type`.
|
| 103 |
|
| 104 |
-
[*Note 3*: For example, in some cases `key_type` and `mapped_type`
|
| 105 |
-
|
| 106 |
-
`
|
| 107 |
*Cpp17CopyAssignable*. — *end note*]
|
| 108 |
|
| 109 |
``` cpp
|
| 110 |
typename X::key_type
|
| 111 |
```
|
|
@@ -324,12 +323,11 @@ a.emplace_hint(p, args)
|
|
| 324 |
|
| 325 |
*Effects:* Equivalent to `a.emplace(std::forward<Args>(args)...)`,
|
| 326 |
except that the element is inserted as close as possible to the position
|
| 327 |
just prior to `p`.
|
| 328 |
|
| 329 |
-
*Returns:*
|
| 330 |
-
to the newly inserted element.
|
| 331 |
|
| 332 |
*Complexity:* Logarithmic in general, but amortized constant if the
|
| 333 |
element is inserted right before `p`.
|
| 334 |
|
| 335 |
``` cpp
|
|
@@ -538,21 +536,22 @@ a.extract(q)
|
|
| 538 |
a.merge(a2)
|
| 539 |
```
|
| 540 |
|
| 541 |
*Result:* `void`
|
| 542 |
|
| 543 |
-
*Preconditions:* `a.get_allocator() == a2.get_allocator()`.
|
| 544 |
|
| 545 |
*Effects:* Attempts to extract each element in `a2` and insert it into
|
| 546 |
`a` using the comparison object of `a`. In containers with unique keys,
|
| 547 |
if there is an element in `a` with key equivalent to the key of an
|
| 548 |
element from `a2`, then that element is not extracted from `a2`.
|
| 549 |
|
| 550 |
*Ensures:* Pointers and references to the transferred elements of `a2`
|
| 551 |
-
refer to those same elements but as members of `a`.
|
| 552 |
-
|
| 553 |
-
|
|
|
|
| 554 |
|
| 555 |
*Throws:* Nothing unless the comparison object throws.
|
| 556 |
|
| 557 |
*Complexity:* N log(`a.size()+` N), where N has the value `a2.size()`.
|
| 558 |
|
|
@@ -724,11 +723,11 @@ b.upper_bound(k)
|
|
| 724 |
*Result:* `iterator`; `const_iterator` for constant `b`.
|
| 725 |
|
| 726 |
*Returns:* An iterator pointing to the first element with key greater
|
| 727 |
than `k`, or `b.end()` if such an element is not found.
|
| 728 |
|
| 729 |
-
*Complexity:* Logarithmic
|
| 730 |
|
| 731 |
``` cpp
|
| 732 |
a_tran.upper_bound(ku)
|
| 733 |
```
|
| 734 |
|
|
|
|
| 52 |
|
| 53 |
- `X` denotes an associative container class,
|
| 54 |
- `a` denotes a value of type `X`,
|
| 55 |
- `a2` denotes a value of a type with nodes compatible with type `X` (
|
| 56 |
[[container.node.compat]]),
|
| 57 |
+
- `b` denotes a value of type `X` or `const X`,
|
| 58 |
- `u` denotes the name of a variable being declared,
|
| 59 |
- `a_uniq` denotes a value of type `X` when `X` supports unique keys,
|
| 60 |
+
- `a_eq` denotes a value of type `X` when `X` supports equivalent keys,
|
| 61 |
- `a_tran` denotes a value of type `X` or `const X` when the
|
| 62 |
*qualified-id* `X::key_compare::is_transparent` is valid and denotes a
|
| 63 |
type [[temp.deduct]],
|
| 64 |
- `i` and `j` meet the *Cpp17InputIterator* requirements and refer to
|
| 65 |
elements implicitly convertible to `value_type`,
|
|
|
|
| 67 |
- `rg` denotes a value of a type `R` that models
|
| 68 |
`container-compatible-range<value_type>`,
|
| 69 |
- `p` denotes a valid constant iterator to `a`,
|
| 70 |
- `q` denotes a valid dereferenceable constant iterator to `a`,
|
| 71 |
- `r` denotes a valid dereferenceable iterator to `a`,
|
| 72 |
+
- \[`q1`, `q2`) denotes a valid range of constant iterators in `a`,
|
| 73 |
- `il` designates an object of type `initializer_list<value_type>`,
|
| 74 |
- `t` denotes a value of type `X::value_type`,
|
| 75 |
- `k` denotes a value of type `X::key_type`, and
|
| 76 |
- `c` denotes a value of type `X::key_compare` or
|
| 77 |
`const X::key_compare`;
|
|
|
|
| 93 |
- `m` denotes an allocator of a type convertible to `A`, and `nh`
|
| 94 |
denotes a non-const rvalue of type `X::node_type`.
|
| 95 |
|
| 96 |
A type `X` meets the *associative container* requirements if `X` meets
|
| 97 |
all the requirements of an allocator-aware container
|
| 98 |
+
[[container.alloc.reqmts]] and the following types, statements, and
|
| 99 |
+
expressions are well-formed and have the specified semantics, except
|
| 100 |
that for `map` and `multimap`, the requirements placed on `value_type`
|
| 101 |
+
in [[container.reqmts]] apply instead to `key_type` and `mapped_type`.
|
|
|
|
| 102 |
|
| 103 |
+
[*Note 3*: For example, in some cases `key_type` and `mapped_type` need
|
| 104 |
+
to be *Cpp17CopyAssignable* even though the associated `value_type`,
|
| 105 |
+
`pair<const key_type, mapped_type>`, is not
|
| 106 |
*Cpp17CopyAssignable*. — *end note*]
|
| 107 |
|
| 108 |
``` cpp
|
| 109 |
typename X::key_type
|
| 110 |
```
|
|
|
|
| 323 |
|
| 324 |
*Effects:* Equivalent to `a.emplace(std::forward<Args>(args)...)`,
|
| 325 |
except that the element is inserted as close as possible to the position
|
| 326 |
just prior to `p`.
|
| 327 |
|
| 328 |
+
*Returns:* The iterator returned by `emplace`.
|
|
|
|
| 329 |
|
| 330 |
*Complexity:* Logarithmic in general, but amortized constant if the
|
| 331 |
element is inserted right before `p`.
|
| 332 |
|
| 333 |
``` cpp
|
|
|
|
| 536 |
a.merge(a2)
|
| 537 |
```
|
| 538 |
|
| 539 |
*Result:* `void`
|
| 540 |
|
| 541 |
+
*Preconditions:* `a.get_allocator() == a2.get_allocator()` is `true`.
|
| 542 |
|
| 543 |
*Effects:* Attempts to extract each element in `a2` and insert it into
|
| 544 |
`a` using the comparison object of `a`. In containers with unique keys,
|
| 545 |
if there is an element in `a` with key equivalent to the key of an
|
| 546 |
element from `a2`, then that element is not extracted from `a2`.
|
| 547 |
|
| 548 |
*Ensures:* Pointers and references to the transferred elements of `a2`
|
| 549 |
+
refer to those same elements but as members of `a`. If `a.begin()` and
|
| 550 |
+
`a2.begin()` have the same type, iterators referring to the transferred
|
| 551 |
+
elements will continue to refer to their elements, but they now behave
|
| 552 |
+
as iterators into `a`, not into `a2`.
|
| 553 |
|
| 554 |
*Throws:* Nothing unless the comparison object throws.
|
| 555 |
|
| 556 |
*Complexity:* N log(`a.size()+` N), where N has the value `a2.size()`.
|
| 557 |
|
|
|
|
| 723 |
*Result:* `iterator`; `const_iterator` for constant `b`.
|
| 724 |
|
| 725 |
*Returns:* An iterator pointing to the first element with key greater
|
| 726 |
than `k`, or `b.end()` if such an element is not found.
|
| 727 |
|
| 728 |
+
*Complexity:* Logarithmic.
|
| 729 |
|
| 730 |
``` cpp
|
| 731 |
a_tran.upper_bound(ku)
|
| 732 |
```
|
| 733 |
|