From Jason Turner

[unord.map.modifiers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp7ywpxit7/{from.md → to.md} +15 -15
tmp/tmp7ywpxit7/{from.md → to.md} RENAMED
@@ -1,36 +1,34 @@
1
- #### `unordered_map` modifiers <a id="unord.map.modifiers">[[unord.map.modifiers]]</a>
2
 
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
@@ -48,11 +46,11 @@ 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
@@ -72,13 +70,14 @@ 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)`.
@@ -94,13 +93,14 @@ 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)`.
 
1
+ #### Modifiers <a id="unord.map.modifiers">[[unord.map.modifiers]]</a>
2
 
3
  ``` cpp
4
  template<class P>
5
  pair<iterator, bool> insert(P&& obj);
6
  ```
7
 
8
+ *Constraints:* `is_constructible_v<value_type, P&&>` is `true`.
9
+
10
  *Effects:* Equivalent to: `return emplace(std::forward<P>(obj));`
11
 
 
 
 
12
  ``` cpp
13
  template<class P>
14
  iterator insert(const_iterator hint, P&& obj);
15
  ```
16
 
17
+ *Constraints:* `is_constructible_v<value_type, P&&>` is `true`.
18
+
19
  *Effects:* Equivalent to:
20
  `return emplace_hint(hint, std::forward<P>(obj));`
21
 
 
 
 
22
  ``` cpp
23
  template<class... Args>
24
  pair<iterator, bool> try_emplace(const key_type& k, Args&&... args);
25
  template<class... Args>
26
  iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args);
27
  ```
28
 
29
+ *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into
30
  `unordered_map` from `piecewise_construct`, `forward_as_tuple(k)`,
31
  `forward_as_tuple(std::forward<Args>(args)...)`.
32
 
33
  *Effects:* If the map already contains an element whose key is
34
  equivalent to `k`, there is no effect. Otherwise inserts an object of
 
46
  pair<iterator, bool> try_emplace(key_type&& k, Args&&... args);
47
  template<class... Args>
48
  iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args);
49
  ```
50
 
51
+ *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into
52
  `unordered_map` from `piecewise_construct`,
53
  `forward_as_tuple(std::move(k))`,
54
  `forward_as_tuple(std::forward<Args>(args)...)`.
55
 
56
  *Effects:* If the map already contains an element whose key is
 
70
  pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj);
71
  template<class M>
72
  iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj);
73
  ```
74
 
75
+ *Mandates:* `is_assignable_v<mapped_type&, M&&>` is `true`.
76
+
77
+ *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into
78
+ `unordered_map` from `k`, `std::forward<M>(obj)`.
79
 
80
  *Effects:* If the map already contains an element `e` whose key is
81
  equivalent to `k`, assigns `std::forward<M>(obj)` to `e.second`.
82
  Otherwise inserts an object of type `value_type` constructed with `k`,
83
  `std::forward<M>(obj)`.
 
93
  pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj);
94
  template<class M>
95
  iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj);
96
  ```
97
 
98
+ *Mandates:* `is_assignable_v<mapped_type&, M&&>` is `true`.
99
+
100
+ *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into
101
+ `unordered_map` from `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)`.