From Jason Turner

[map.modifiers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpyoybvlrj/{from.md → to.md} +15 -14
tmp/tmpyoybvlrj/{from.md → to.md} RENAMED
@@ -1,30 +1,29 @@
1
- #### `map` modifiers <a id="map.modifiers">[[map.modifiers]]</a>
2
 
3
  ``` cpp
4
  template<class P>
5
  pair<iterator, bool> insert(P&& x);
6
  template<class P>
7
  iterator insert(const_iterator position, P&& x);
8
  ```
9
 
 
 
10
  *Effects:* The first form is equivalent to
11
  `return emplace(std::forward<P>(x))`. The second form is equivalent to
12
  `return emplace_hint(position, std::forward<P>(x))`.
13
 
14
- *Remarks:* These signatures shall not participate in overload resolution
15
- unless `is_constructible_v<value_type, P&&>` is `true`.
16
-
17
  ``` cpp
18
  template<class... Args>
19
  pair<iterator, bool> try_emplace(const key_type& k, Args&&... args);
20
  template<class... Args>
21
  iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args);
22
  ```
23
 
24
- *Requires:* `value_type` shall be `EmplaceConstructible` into `map` from
25
- `piecewise_construct`, `forward_as_tuple(k)`,
26
  `forward_as_tuple(std::forward<Args>(args)...)`.
27
 
28
  *Effects:* If the map already contains an element whose key is
29
  equivalent to `k`, there is no effect. Otherwise inserts an object of
30
  type `value_type` constructed with `piecewise_construct`,
@@ -41,12 +40,12 @@ template <class... Args>
41
  pair<iterator, bool> try_emplace(key_type&& k, Args&&... args);
42
  template<class... Args>
43
  iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args);
44
  ```
45
 
46
- *Requires:* `value_type` shall be `EmplaceConstructible` into `map` from
47
- `piecewise_construct`, `forward_as_tuple(std::move(k))`,
48
  `forward_as_tuple(std::forward<Args>(args)...)`.
49
 
50
  *Effects:* If the map already contains an element whose key is
51
  equivalent to `k`, there is no effect. Otherwise inserts an object of
52
  type `value_type` constructed with `piecewise_construct`,
@@ -64,13 +63,14 @@ template <class M>
64
  pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj);
65
  template<class M>
66
  iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj);
67
  ```
68
 
69
- *Requires:* `is_assignable_v<mapped_type&, M&&>` shall be `true`.
70
- `value_type` shall be `EmplaceConstructible` into `map` from `k`,
71
- `forward<M>(obj)`.
 
72
 
73
  *Effects:* If the map already contains an element `e` whose key is
74
  equivalent to `k`, assigns `std::forward<M>(obj)` to `e.second`.
75
  Otherwise inserts an object of type `value_type` constructed with `k`,
76
  `std::forward<M>(obj)`.
@@ -86,13 +86,14 @@ template <class M>
86
  pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj);
87
  template<class M>
88
  iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj);
89
  ```
90
 
91
- *Requires:* `is_assignable_v<mapped_type&, M&&>` shall be `true`.
92
- `value_type` shall be `EmplaceConstructible` into `map` from `move(k)`,
93
- `forward<M>(obj)`.
 
94
 
95
  *Effects:* If the map already contains an element `e` whose key is
96
  equivalent to `k`, assigns `std::forward<M>(obj)` to `e.second`.
97
  Otherwise inserts an object of type `value_type` constructed with
98
  `std::move(k)`, `std::forward<M>(obj)`.
 
1
+ #### Modifiers <a id="map.modifiers">[[map.modifiers]]</a>
2
 
3
  ``` cpp
4
  template<class P>
5
  pair<iterator, bool> insert(P&& x);
6
  template<class P>
7
  iterator insert(const_iterator position, P&& x);
8
  ```
9
 
10
+ *Constraints:* `is_constructible_v<value_type, P&&>` is `true`.
11
+
12
  *Effects:* The first form is equivalent to
13
  `return emplace(std::forward<P>(x))`. The second form is equivalent to
14
  `return emplace_hint(position, std::forward<P>(x))`.
15
 
 
 
 
16
  ``` cpp
17
  template<class... Args>
18
  pair<iterator, bool> try_emplace(const key_type& k, Args&&... args);
19
  template<class... Args>
20
  iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args);
21
  ```
22
 
23
+ *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into `map`
24
+ from `piecewise_construct`, `forward_as_tuple(k)`,
25
  `forward_as_tuple(std::forward<Args>(args)...)`.
26
 
27
  *Effects:* If the map already contains an element whose key is
28
  equivalent to `k`, there is no effect. Otherwise inserts an object of
29
  type `value_type` constructed with `piecewise_construct`,
 
40
  pair<iterator, bool> try_emplace(key_type&& k, Args&&... args);
41
  template<class... Args>
42
  iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args);
43
  ```
44
 
45
+ *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into `map`
46
+ from `piecewise_construct`, `forward_as_tuple(std::move(k))`,
47
  `forward_as_tuple(std::forward<Args>(args)...)`.
48
 
49
  *Effects:* If the map already contains an element whose key is
50
  equivalent to `k`, there is no effect. Otherwise inserts an object of
51
  type `value_type` constructed with `piecewise_construct`,
 
63
  pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj);
64
  template<class M>
65
  iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj);
66
  ```
67
 
68
+ *Mandates:* `is_assignable_v<mapped_type&, M&&>` is `true`.
69
+
70
+ *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into `map`
71
+ from `k`, `forward<M>(obj)`.
72
 
73
  *Effects:* If the map already contains an element `e` whose key is
74
  equivalent to `k`, assigns `std::forward<M>(obj)` to `e.second`.
75
  Otherwise inserts an object of type `value_type` constructed with `k`,
76
  `std::forward<M>(obj)`.
 
86
  pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj);
87
  template<class M>
88
  iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj);
89
  ```
90
 
91
+ *Mandates:* `is_assignable_v<mapped_type&, M&&>` is `true`.
92
+
93
+ *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into `map`
94
+ from `move(k)`, `forward<M>(obj)`.
95
 
96
  *Effects:* If the map already contains an element `e` whose key is
97
  equivalent to `k`, assigns `std::forward<M>(obj)` to `e.second`.
98
  Otherwise inserts an object of type `value_type` constructed with
99
  `std::move(k)`, `std::forward<M>(obj)`.