From Jason Turner

[unord.multimap.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4qnakj0y/{from.md → to.md} +103 -102
tmp/tmp4qnakj0y/{from.md → to.md} RENAMED
@@ -17,10 +17,13 @@ the `mapped_type` is `T`, and the `value_type` is `pair<const Key, T>`.
17
 
18
  Subclause  [[unord.multimap]] only describes operations on
19
  `unordered_multimap` that are not described in one of the requirement
20
  tables, or for which there is additional semantic information.
21
 
 
 
 
22
  ``` cpp
23
  namespace std {
24
  template<class Key,
25
  class T,
26
  class Hash = hash<Key>,
@@ -33,12 +36,12 @@ namespace std {
33
  using mapped_type = T;
34
  using value_type = pair<const Key, T>;
35
  using hasher = Hash;
36
  using key_equal = Pred;
37
  using allocator_type = Allocator;
38
- using pointer = typename allocator_traits<Allocator>::pointer;
39
- using const_pointer = typename allocator_traits<Allocator>::const_pointer;
40
  using reference = value_type&;
41
  using const_reference = const value_type&;
42
  using size_type = implementation-defined // type of unordered_multimap::size_type; // see [container.requirements]
43
  using difference_type = implementation-defined // type of unordered_multimap::difference_type; // see [container.requirements]
44
 
@@ -47,165 +50,163 @@ namespace std {
47
  using local_iterator = implementation-defined // type of unordered_multimap::local_iterator; // see [container.requirements]
48
  using const_local_iterator = implementation-defined // type of unordered_multimap::const_local_iterator; // see [container.requirements]
49
  using node_type = unspecified;
50
 
51
  // [unord.multimap.cnstr], construct/copy/destroy
52
- unordered_multimap();
53
- explicit unordered_multimap(size_type n,
54
- const hasher& hf = hasher(),
55
  const key_equal& eql = key_equal(),
56
  const allocator_type& a = allocator_type());
57
  template<class InputIterator>
58
- unordered_multimap(InputIterator f, InputIterator l,
59
- size_type n = see below,
60
- const hasher& hf = hasher(),
61
  const key_equal& eql = key_equal(),
62
  const allocator_type& a = allocator_type());
63
  template<container-compatible-range<value_type> R>
64
- unordered_multimap(from_range_t, R&& rg,
65
- size_type n = see below,
66
- const hasher& hf = hasher(),
67
  const key_equal& eql = key_equal(),
68
  const allocator_type& a = allocator_type());
69
- unordered_multimap(const unordered_multimap&);
70
- unordered_multimap(unordered_multimap&&);
71
- explicit unordered_multimap(const Allocator&);
72
- unordered_multimap(const unordered_multimap&, const type_identity_t<Allocator>&);
73
- unordered_multimap(unordered_multimap&&, const type_identity_t<Allocator>&);
74
- unordered_multimap(initializer_list<value_type> il,
75
- size_type n = see below,
76
- const hasher& hf = hasher(),
77
  const key_equal& eql = key_equal(),
78
  const allocator_type& a = allocator_type());
79
- unordered_multimap(size_type n, const allocator_type& a)
80
  : unordered_multimap(n, hasher(), key_equal(), a) { }
81
- unordered_multimap(size_type n, const hasher& hf, const allocator_type& a)
82
  : unordered_multimap(n, hf, key_equal(), a) { }
83
  template<class InputIterator>
84
- unordered_multimap(InputIterator f, InputIterator l, size_type n, const allocator_type& a)
 
85
  : unordered_multimap(f, l, n, hasher(), key_equal(), a) { }
86
  template<class InputIterator>
87
- unordered_multimap(InputIterator f, InputIterator l, size_type n, const hasher& hf,
88
- const allocator_type& a)
89
  : unordered_multimap(f, l, n, hf, key_equal(), a) { }
90
  template<container-compatible-range<value_type> R>
91
- unordered_multimap(from_range_t, R&& rg, size_type n, const allocator_type& a)
92
  : unordered_multimap(from_range, std::forward<R>(rg),
93
  n, hasher(), key_equal(), a) { }
94
  template<container-compatible-range<value_type> R>
95
- unordered_multimap(from_range_t, R&& rg, size_type n, const hasher& hf,
96
  const allocator_type& a)
97
  : unordered_multimap(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { }
98
- unordered_multimap(initializer_list<value_type> il, size_type n, const allocator_type& a)
 
99
  : unordered_multimap(il, n, hasher(), key_equal(), a) { }
100
- unordered_multimap(initializer_list<value_type> il, size_type n, const hasher& hf,
101
  const allocator_type& a)
102
  : unordered_multimap(il, n, hf, key_equal(), a) { }
103
- ~unordered_multimap();
104
- unordered_multimap& operator=(const unordered_multimap&);
105
- unordered_multimap& operator=(unordered_multimap&&)
106
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
107
- is_nothrow_move_assignable_v<Hash> &&
108
- is_nothrow_move_assignable_v<Pred>);
109
- unordered_multimap& operator=(initializer_list<value_type>);
110
- allocator_type get_allocator() const noexcept;
111
 
112
  // iterators
113
- iterator begin() noexcept;
114
- const_iterator begin() const noexcept;
115
- iterator end() noexcept;
116
- const_iterator end() const noexcept;
117
- const_iterator cbegin() const noexcept;
118
- const_iterator cend() const noexcept;
119
 
120
  // capacity
121
- [[nodiscard]] bool empty() const noexcept;
122
- size_type size() const noexcept;
123
- size_type max_size() const noexcept;
124
 
125
  // [unord.multimap.modifiers], modifiers
126
- template<class... Args> iterator emplace(Args&&... args);
127
- template<class... Args> iterator emplace_hint(const_iterator position, Args&&... args);
128
- iterator insert(const value_type& obj);
129
- iterator insert(value_type&& obj);
130
- template<class P> iterator insert(P&& obj);
131
- iterator insert(const_iterator hint, const value_type& obj);
132
- iterator insert(const_iterator hint, value_type&& obj);
133
- template<class P> iterator insert(const_iterator hint, P&& obj);
134
- template<class InputIterator> void insert(InputIterator first, InputIterator last);
 
135
  template<container-compatible-range<value_type> R>
136
- void insert_range(R&& rg);
137
- void insert(initializer_list<value_type>);
138
 
139
- node_type extract(const_iterator position);
140
- node_type extract(const key_type& x);
141
- template<class K> node_type extract(K&& x);
142
- iterator insert(node_type&& nh);
143
- iterator insert(const_iterator hint, node_type&& nh);
144
 
145
- iterator erase(iterator position);
146
- iterator erase(const_iterator position);
147
- size_type erase(const key_type& k);
148
- template<class K> size_type erase(K&& x);
149
- iterator erase(const_iterator first, const_iterator last);
150
- void swap(unordered_multimap&)
151
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
152
- is_nothrow_swappable_v<Hash> &&
153
- is_nothrow_swappable_v<Pred>);
154
- void clear() noexcept;
155
 
156
  template<class H2, class P2>
157
- void merge(unordered_multimap<Key, T, H2, P2, Allocator>& source);
158
  template<class H2, class P2>
159
- void merge(unordered_multimap<Key, T, H2, P2, Allocator>&& source);
160
  template<class H2, class P2>
161
- void merge(unordered_map<Key, T, H2, P2, Allocator>& source);
162
  template<class H2, class P2>
163
- void merge(unordered_map<Key, T, H2, P2, Allocator>&& source);
164
 
165
  // observers
166
- hasher hash_function() const;
167
- key_equal key_eq() const;
168
 
169
  // map operations
170
- iterator find(const key_type& k);
171
- const_iterator find(const key_type& k) const;
172
  template<class K>
173
- iterator find(const K& k);
174
  template<class K>
175
- const_iterator find(const K& k) const;
176
- size_type count(const key_type& k) const;
177
  template<class K>
178
- size_type count(const K& k) const;
179
- bool contains(const key_type& k) const;
180
  template<class K>
181
- bool contains(const K& k) const;
182
- pair<iterator, iterator> equal_range(const key_type& k);
183
- pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
184
  template<class K>
185
- pair<iterator, iterator> equal_range(const K& k);
186
  template<class K>
187
- pair<const_iterator, const_iterator> equal_range(const K& k) const;
188
 
189
  // bucket interface
190
- size_type bucket_count() const noexcept;
191
- size_type max_bucket_count() const noexcept;
192
- size_type bucket_size(size_type n) const;
193
- size_type bucket(const key_type& k) const;
194
- local_iterator begin(size_type n);
195
- const_local_iterator begin(size_type n) const;
196
- local_iterator end(size_type n);
197
- const_local_iterator end(size_type n) const;
198
- const_local_iterator cbegin(size_type n) const;
199
- const_local_iterator cend(size_type n) const;
 
200
 
201
  // hash policy
202
- float load_factor() const noexcept;
203
- float max_load_factor() const noexcept;
204
- void max_load_factor(float z);
205
- void rehash(size_type n);
206
- void reserve(size_type n);
207
  };
208
 
209
  template<class InputIterator,
210
  class Hash = hash<iter-key-type<InputIterator>>,
211
  class Pred = equal_to<iter-key-type<InputIterator>>,
 
17
 
18
  Subclause  [[unord.multimap]] only describes operations on
19
  `unordered_multimap` that are not described in one of the requirement
20
  tables, or for which there is additional semantic information.
21
 
22
+ The types `iterator` and `const_iterator` meet the constexpr iterator
23
+ requirements [[iterator.requirements.general]].
24
+
25
  ``` cpp
26
  namespace std {
27
  template<class Key,
28
  class T,
29
  class Hash = hash<Key>,
 
36
  using mapped_type = T;
37
  using value_type = pair<const Key, T>;
38
  using hasher = Hash;
39
  using key_equal = Pred;
40
  using allocator_type = Allocator;
41
+ using pointer = allocator_traits<Allocator>::pointer;
42
+ using const_pointer = allocator_traits<Allocator>::const_pointer;
43
  using reference = value_type&;
44
  using const_reference = const value_type&;
45
  using size_type = implementation-defined // type of unordered_multimap::size_type; // see [container.requirements]
46
  using difference_type = implementation-defined // type of unordered_multimap::difference_type; // see [container.requirements]
47
 
 
50
  using local_iterator = implementation-defined // type of unordered_multimap::local_iterator; // see [container.requirements]
51
  using const_local_iterator = implementation-defined // type of unordered_multimap::const_local_iterator; // see [container.requirements]
52
  using node_type = unspecified;
53
 
54
  // [unord.multimap.cnstr], construct/copy/destroy
55
+ constexpr unordered_multimap();
56
+ constexpr explicit unordered_multimap(size_type n, const hasher& hf = hasher(),
 
57
  const key_equal& eql = key_equal(),
58
  const allocator_type& a = allocator_type());
59
  template<class InputIterator>
60
+ constexpr unordered_multimap(InputIterator f, InputIterator l,
61
+ size_type n = see below, const hasher& hf = hasher(),
 
62
  const key_equal& eql = key_equal(),
63
  const allocator_type& a = allocator_type());
64
  template<container-compatible-range<value_type> R>
65
+ constexpr unordered_multimap(from_range_t, R&& rg,
66
+ size_type n = see below, const hasher& hf = hasher(),
 
67
  const key_equal& eql = key_equal(),
68
  const allocator_type& a = allocator_type());
69
+ constexpr unordered_multimap(const unordered_multimap&);
70
+ constexpr unordered_multimap(unordered_multimap&&);
71
+ constexpr explicit unordered_multimap(const Allocator&);
72
+ constexpr unordered_multimap(const unordered_multimap&, const type_identity_t<Allocator>&);
73
+ constexpr unordered_multimap(unordered_multimap&&, const type_identity_t<Allocator>&);
74
+ constexpr unordered_multimap(initializer_list<value_type> il,
75
+ size_type n = see below, const hasher& hf = hasher(),
 
76
  const key_equal& eql = key_equal(),
77
  const allocator_type& a = allocator_type());
78
+ constexpr unordered_multimap(size_type n, const allocator_type& a)
79
  : unordered_multimap(n, hasher(), key_equal(), a) { }
80
+ constexpr unordered_multimap(size_type n, const hasher& hf, const allocator_type& a)
81
  : unordered_multimap(n, hf, key_equal(), a) { }
82
  template<class InputIterator>
83
+ constexpr unordered_multimap(InputIterator f, InputIterator l, size_type n,
84
+ const allocator_type& a)
85
  : unordered_multimap(f, l, n, hasher(), key_equal(), a) { }
86
  template<class InputIterator>
87
+ constexpr unordered_multimap(InputIterator f, InputIterator l, size_type n,
88
+ const hasher& hf, const allocator_type& a)
89
  : unordered_multimap(f, l, n, hf, key_equal(), a) { }
90
  template<container-compatible-range<value_type> R>
91
+ constexpr unordered_multimap(from_range_t, R&& rg, size_type n, const allocator_type& a)
92
  : unordered_multimap(from_range, std::forward<R>(rg),
93
  n, hasher(), key_equal(), a) { }
94
  template<container-compatible-range<value_type> R>
95
+ constexpr unordered_multimap(from_range_t, R&& rg, size_type n, const hasher& hf,
96
  const allocator_type& a)
97
  : unordered_multimap(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { }
98
+ constexpr unordered_multimap(initializer_list<value_type> il, size_type n,
99
+ const allocator_type& a)
100
  : unordered_multimap(il, n, hasher(), key_equal(), a) { }
101
+ constexpr unordered_multimap(initializer_list<value_type> il, size_type n, const hasher& hf,
102
  const allocator_type& a)
103
  : unordered_multimap(il, n, hf, key_equal(), a) { }
104
+ constexpr ~unordered_multimap();
105
+ constexpr unordered_multimap& operator=(const unordered_multimap&);
106
+ constexpr unordered_multimap& operator=(unordered_multimap&&)
107
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
108
+ is_nothrow_move_assignable_v<Hash> && is_nothrow_move_assignable_v<Pred>);
109
+ constexpr unordered_multimap& operator=(initializer_list<value_type>);
110
+ constexpr allocator_type get_allocator() const noexcept;
 
111
 
112
  // iterators
113
+ constexpr iterator begin() noexcept;
114
+ constexpr const_iterator begin() const noexcept;
115
+ constexpr iterator end() noexcept;
116
+ constexpr const_iterator end() const noexcept;
117
+ constexpr const_iterator cbegin() const noexcept;
118
+ constexpr const_iterator cend() const noexcept;
119
 
120
  // capacity
121
+ constexpr bool empty() const noexcept;
122
+ constexpr size_type size() const noexcept;
123
+ constexpr size_type max_size() const noexcept;
124
 
125
  // [unord.multimap.modifiers], modifiers
126
+ template<class... Args> constexpr iterator emplace(Args&&... args);
127
+ template<class... Args>
128
+ constexpr iterator emplace_hint(const_iterator position, Args&&... args);
129
+ constexpr iterator insert(const value_type& obj);
130
+ constexpr iterator insert(value_type&& obj);
131
+ template<class P> constexpr iterator insert(P&& obj);
132
+ constexpr iterator insert(const_iterator hint, const value_type& obj);
133
+ constexpr iterator insert(const_iterator hint, value_type&& obj);
134
+ template<class P> constexpr iterator insert(const_iterator hint, P&& obj);
135
+ template<class InputIterator> constexpr void insert(InputIterator first, InputIterator last);
136
  template<container-compatible-range<value_type> R>
137
+ constexpr void insert_range(R&& rg);
138
+ constexpr void insert(initializer_list<value_type>);
139
 
140
+ constexpr node_type extract(const_iterator position);
141
+ constexpr node_type extract(const key_type& x);
142
+ template<class K> constexpr node_type extract(K&& x);
143
+ constexpr iterator insert(node_type&& nh);
144
+ constexpr iterator insert(const_iterator hint, node_type&& nh);
145
 
146
+ constexpr iterator erase(iterator position);
147
+ constexpr iterator erase(const_iterator position);
148
+ constexpr size_type erase(const key_type& k);
149
+ template<class K> constexpr size_type erase(K&& x);
150
+ constexpr iterator erase(const_iterator first, const_iterator last);
151
+ constexpr void swap(unordered_multimap&)
152
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
153
+ is_nothrow_swappable_v<Hash> && is_nothrow_swappable_v<Pred>);
154
+ constexpr void clear() noexcept;
 
155
 
156
  template<class H2, class P2>
157
+ constexpr void merge(unordered_multimap<Key, T, H2, P2, Allocator>& source);
158
  template<class H2, class P2>
159
+ constexpr void merge(unordered_multimap<Key, T, H2, P2, Allocator>&& source);
160
  template<class H2, class P2>
161
+ constexpr void merge(unordered_map<Key, T, H2, P2, Allocator>& source);
162
  template<class H2, class P2>
163
+ constexpr void merge(unordered_map<Key, T, H2, P2, Allocator>&& source);
164
 
165
  // observers
166
+ constexpr hasher hash_function() const;
167
+ constexpr key_equal key_eq() const;
168
 
169
  // map operations
170
+ constexpr iterator find(const key_type& k);
171
+ constexpr const_iterator find(const key_type& k) const;
172
  template<class K>
173
+ constexpr iterator find(const K& k);
174
  template<class K>
175
+ constexpr const_iterator find(const K& k) const;
176
+ constexpr size_type count(const key_type& k) const;
177
  template<class K>
178
+ constexpr size_type count(const K& k) const;
179
+ constexpr bool contains(const key_type& k) const;
180
  template<class K>
181
+ constexpr bool contains(const K& k) const;
182
+ constexpr pair<iterator, iterator> equal_range(const key_type& k);
183
+ constexpr pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
184
  template<class K>
185
+ constexpr pair<iterator, iterator> equal_range(const K& k);
186
  template<class K>
187
+ constexpr pair<const_iterator, const_iterator> equal_range(const K& k) const;
188
 
189
  // bucket interface
190
+ constexpr size_type bucket_count() const noexcept;
191
+ constexpr size_type max_bucket_count() const noexcept;
192
+ constexpr size_type bucket_size(size_type n) const;
193
+ constexpr size_type bucket(const key_type& k) const;
194
+ template<class K> constexpr size_type bucket(const K& k) const;
195
+ constexpr local_iterator begin(size_type n);
196
+ constexpr const_local_iterator begin(size_type n) const;
197
+ constexpr local_iterator end(size_type n);
198
+ constexpr const_local_iterator end(size_type n) const;
199
+ constexpr const_local_iterator cbegin(size_type n) const;
200
+ constexpr const_local_iterator cend(size_type n) const;
201
 
202
  // hash policy
203
+ constexpr float load_factor() const noexcept;
204
+ constexpr float max_load_factor() const noexcept;
205
+ constexpr void max_load_factor(float z);
206
+ constexpr void rehash(size_type n);
207
+ constexpr void reserve(size_type n);
208
  };
209
 
210
  template<class InputIterator,
211
  class Hash = hash<iter-key-type<InputIterator>>,
212
  class Pred = equal_to<iter-key-type<InputIterator>>,