tmp/tmpsp05_f88/{from.md → to.md}
RENAMED
|
@@ -3,21 +3,111 @@
|
|
| 3 |
``` cpp
|
| 4 |
template <class P>
|
| 5 |
pair<iterator, bool> insert(P&& obj);
|
| 6 |
```
|
| 7 |
|
| 8 |
-
*Effects:* Equivalent to `return emplace(std::forward<P>(obj))`
|
| 9 |
|
| 10 |
*Remarks:* This signature shall not participate in overload resolution
|
| 11 |
-
unless `
|
| 12 |
|
| 13 |
``` cpp
|
| 14 |
template <class P>
|
| 15 |
iterator insert(const_iterator hint, P&& obj);
|
| 16 |
```
|
| 17 |
|
| 18 |
-
*Effects:* Equivalent to
|
| 19 |
-
`return emplace_hint(hint, std::forward<P>(obj))`
|
| 20 |
|
| 21 |
*Remarks:* This signature shall not participate in overload resolution
|
| 22 |
-
unless `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
|
|
|
| 3 |
``` cpp
|
| 4 |
template <class P>
|
| 5 |
pair<iterator, bool> insert(P&& obj);
|
| 6 |
```
|
| 7 |
|
| 8 |
+
*Effects:* Equivalent to: `return emplace(std::forward<P>(obj));`
|
| 9 |
|
| 10 |
*Remarks:* This signature shall not participate in overload resolution
|
| 11 |
+
unless `is_constructible_v<value_type, P&&>` is `true`.
|
| 12 |
|
| 13 |
``` cpp
|
| 14 |
template <class P>
|
| 15 |
iterator insert(const_iterator hint, P&& obj);
|
| 16 |
```
|
| 17 |
|
| 18 |
+
*Effects:* Equivalent to:
|
| 19 |
+
`return emplace_hint(hint, std::forward<P>(obj));`
|
| 20 |
|
| 21 |
*Remarks:* This signature shall not participate in overload resolution
|
| 22 |
+
unless `is_constructible_v<value_type, P&&>` is `true`.
|
| 23 |
+
|
| 24 |
+
``` cpp
|
| 25 |
+
template <class... Args>
|
| 26 |
+
pair<iterator, bool> try_emplace(const key_type& k, Args&&... args);
|
| 27 |
+
template <class... Args>
|
| 28 |
+
iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args);
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
*Requires:* `value_type` shall be `EmplaceConstructible` into
|
| 32 |
+
`unordered_map` from `piecewise_construct`, `forward_as_tuple(k)`,
|
| 33 |
+
`forward_as_tuple(std::forward<Args>(args)...)`.
|
| 34 |
+
|
| 35 |
+
*Effects:* If the map already contains an element whose key is
|
| 36 |
+
equivalent to `k`, there is no effect. Otherwise inserts an object of
|
| 37 |
+
type `value_type` constructed with `piecewise_construct`,
|
| 38 |
+
`forward_as_tuple(k)`, `forward_as_tuple(std::forward<Args>(args)...)`.
|
| 39 |
+
|
| 40 |
+
*Returns:* In the first overload, the `bool` component of the returned
|
| 41 |
+
pair is `true` if and only if the insertion took place. The returned
|
| 42 |
+
iterator points to the map element whose key is equivalent to `k`.
|
| 43 |
+
|
| 44 |
+
*Complexity:* The same as `emplace` and `emplace_hint`, respectively.
|
| 45 |
+
|
| 46 |
+
``` cpp
|
| 47 |
+
template <class... Args>
|
| 48 |
+
pair<iterator, bool> try_emplace(key_type&& k, Args&&... args);
|
| 49 |
+
template <class... Args>
|
| 50 |
+
iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args);
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
*Requires:* `value_type` shall be `EmplaceConstructible` into
|
| 54 |
+
`unordered_map` from `piecewise_construct`,
|
| 55 |
+
`forward_as_tuple(std::move(k))`,
|
| 56 |
+
`forward_as_tuple(std::forward<Args>(args)...)`.
|
| 57 |
+
|
| 58 |
+
*Effects:* If the map already contains an element whose key is
|
| 59 |
+
equivalent to `k`, there is no effect. Otherwise inserts an object of
|
| 60 |
+
type `value_type` constructed with `piecewise_construct`,
|
| 61 |
+
`forward_as_tuple(std::move(k))`,
|
| 62 |
+
`forward_as_tuple(std::forward<Args>(args)...)`.
|
| 63 |
+
|
| 64 |
+
*Returns:* In the first overload, the `bool` component of the returned
|
| 65 |
+
pair is `true` if and only if the insertion took place. The returned
|
| 66 |
+
iterator points to the map element whose key is equivalent to `k`.
|
| 67 |
+
|
| 68 |
+
*Complexity:* The same as `emplace` and `emplace_hint`, respectively.
|
| 69 |
+
|
| 70 |
+
``` cpp
|
| 71 |
+
template <class M>
|
| 72 |
+
pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj);
|
| 73 |
+
template <class M>
|
| 74 |
+
iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj);
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
*Requires:* `is_assignable_v<mapped_type&, M&&>` shall be `true`.
|
| 78 |
+
`value_type` shall be `EmplaceConstructible` into `unordered_map` from
|
| 79 |
+
`k`, `std::forward<M>(obj)`.
|
| 80 |
+
|
| 81 |
+
*Effects:* If the map already contains an element `e` whose key is
|
| 82 |
+
equivalent to `k`, assigns `std::forward<M>(obj)` to `e.second`.
|
| 83 |
+
Otherwise inserts an object of type `value_type` constructed with `k`,
|
| 84 |
+
`std::forward<M>(obj)`.
|
| 85 |
+
|
| 86 |
+
*Returns:* In the first overload, the `bool` component of the returned
|
| 87 |
+
pair is `true` if and only if the insertion took place. The returned
|
| 88 |
+
iterator points to the map element whose key is equivalent to `k`.
|
| 89 |
+
|
| 90 |
+
*Complexity:* The same as `emplace` and `emplace_hint`, respectively.
|
| 91 |
+
|
| 92 |
+
``` cpp
|
| 93 |
+
template <class M>
|
| 94 |
+
pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj);
|
| 95 |
+
template <class M>
|
| 96 |
+
iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj);
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
*Requires:* `is_assignable_v<mapped_type&, M&&>` shall be `true`.
|
| 100 |
+
`value_type` shall be `EmplaceConstructible` into `unordered_map` from
|
| 101 |
+
`std::move(k)`, `std::forward<M>(obj)`.
|
| 102 |
+
|
| 103 |
+
*Effects:* If the map already contains an element `e` whose key is
|
| 104 |
+
equivalent to `k`, assigns `std::forward<M>(obj)` to `e.second`.
|
| 105 |
+
Otherwise inserts an object of type `value_type` constructed with
|
| 106 |
+
`std::move(k)`, `std::forward<M>(obj)`.
|
| 107 |
+
|
| 108 |
+
*Returns:* In the first overload, the `bool` component of the returned
|
| 109 |
+
pair is `true` if and only if the insertion took place. The returned
|
| 110 |
+
iterator points to the map element whose key is equivalent to `k`.
|
| 111 |
+
|
| 112 |
+
*Complexity:* The same as `emplace` and `emplace_hint`, respectively.
|
| 113 |
|