From Jason Turner

[multimap.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpcavh2nia/{from.md → to.md} +32 -17
tmp/tmpcavh2nia/{from.md → to.md} RENAMED
@@ -1,16 +1,17 @@
1
  #### Overview <a id="multimap.overview">[[multimap.overview]]</a>
2
 
3
  A `multimap` is an associative container that supports equivalent keys
4
- (possibly containing multiple copies of the same key value) and provides
5
- for fast retrieval of values of another type `T` based on the keys. The
6
- `multimap` class supports bidirectional iterators.
7
 
8
- A `multimap` meets all of the requirements of a container and of a
9
- reversible container [[container.requirements]], of an associative
10
- container [[associative.reqmts]], and of an allocator-aware container (
11
- [[container.alloc.req]]). A `multimap` also provides most operations
 
12
  described in  [[associative.reqmts]] for equal keys. This means that a
13
  `multimap` supports the `a_eq` operations in  [[associative.reqmts]] but
14
  not the `a_uniq` operations. For a `multimap<Key,T>` the `key_type` is
15
  `Key` and the `value_type` is `pair<const Key,T>`. Descriptions are
16
  provided here only for operations on `multimap` that are not described
@@ -31,12 +32,12 @@ namespace std {
31
  using allocator_type = Allocator;
32
  using pointer = typename allocator_traits<Allocator>::pointer;
33
  using const_pointer = typename allocator_traits<Allocator>::const_pointer;
34
  using reference = value_type&;
35
  using const_reference = const value_type&;
36
- using size_type = implementation-defined; // see [container.requirements]
37
- using difference_type = implementation-defined; // see [container.requirements]
38
  using iterator = implementation-defined // type of multimap::iterator; // see [container.requirements]
39
  using const_iterator = implementation-defined // type of multimap::const_iterator; // see [container.requirements]
40
  using reverse_iterator = std::reverse_iterator<iterator>;
41
  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
42
  using node_type = unspecified;
@@ -44,10 +45,11 @@ namespace std {
44
  class value_compare {
45
  friend class multimap;
46
  protected:
47
  Compare comp;
48
  value_compare(Compare c) : comp(c) { }
 
49
  public:
50
  bool operator()(const value_type& x, const value_type& y) const {
51
  return comp(x.first, y.first);
52
  }
53
  };
@@ -57,21 +59,27 @@ namespace std {
57
  explicit multimap(const Compare& comp, const Allocator& = Allocator());
58
  template<class InputIterator>
59
  multimap(InputIterator first, InputIterator last,
60
  const Compare& comp = Compare(),
61
  const Allocator& = Allocator());
 
 
 
62
  multimap(const multimap& x);
63
  multimap(multimap&& x);
64
  explicit multimap(const Allocator&);
65
- multimap(const multimap&, const Allocator&);
66
- multimap(multimap&&, const Allocator&);
67
  multimap(initializer_list<value_type>,
68
  const Compare& = Compare(),
69
  const Allocator& = Allocator());
70
  template<class InputIterator>
71
  multimap(InputIterator first, InputIterator last, const Allocator& a)
72
  : multimap(first, last, Compare(), a) { }
 
 
 
73
  multimap(initializer_list<value_type> il, const Allocator& a)
74
  : multimap(il, Compare(), a) { }
75
  ~multimap();
76
  multimap& operator=(const multimap& x);
77
  multimap& operator=(multimap&& x)
@@ -110,20 +118,24 @@ namespace std {
110
  iterator insert(const_iterator position, const value_type& x);
111
  iterator insert(const_iterator position, value_type&& x);
112
  template<class P> iterator insert(const_iterator position, P&& x);
113
  template<class InputIterator>
114
  void insert(InputIterator first, InputIterator last);
 
 
115
  void insert(initializer_list<value_type>);
116
 
117
  node_type extract(const_iterator position);
118
  node_type extract(const key_type& x);
 
119
  iterator insert(node_type&& nh);
120
  iterator insert(const_iterator hint, node_type&& nh);
121
 
122
  iterator erase(iterator position);
123
  iterator erase(const_iterator position);
124
  size_type erase(const key_type& x);
 
125
  iterator erase(const_iterator first, const_iterator last);
126
  void swap(multimap&)
127
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
128
  is_nothrow_swappable_v<Compare>);
129
  void clear() noexcept;
@@ -175,27 +187,30 @@ namespace std {
175
  class Allocator = allocator<iter-to-alloc-type<InputIterator>>>
176
  multimap(InputIterator, InputIterator, Compare = Compare(), Allocator = Allocator())
177
  -> multimap<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>,
178
  Compare, Allocator>;
179
 
 
 
 
 
 
180
  template<class Key, class T, class Compare = less<Key>,
181
  class Allocator = allocator<pair<const Key, T>>>
182
  multimap(initializer_list<pair<Key, T>>, Compare = Compare(), Allocator = Allocator())
183
  -> multimap<Key, T, Compare, Allocator>;
184
 
185
  template<class InputIterator, class Allocator>
186
  multimap(InputIterator, InputIterator, Allocator)
187
  -> multimap<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>,
188
  less<iter-key-type<InputIterator>>, Allocator>;
189
 
 
 
 
 
190
  template<class Key, class T, class Allocator>
191
  multimap(initializer_list<pair<Key, T>>, Allocator)
192
  -> multimap<Key, T, less<Key>, Allocator>;
193
-
194
- // swap
195
- template<class Key, class T, class Compare, class Allocator>
196
- void swap(multimap<Key, T, Compare, Allocator>& x,
197
- multimap<Key, T, Compare, Allocator>& y)
198
- noexcept(noexcept(x.swap(y)));
199
  }
200
  ```
201
 
 
1
  #### Overview <a id="multimap.overview">[[multimap.overview]]</a>
2
 
3
  A `multimap` is an associative container that supports equivalent keys
4
+ (i.e., possibly containing multiple copies of the same key value) and
5
+ provides for fast retrieval of values of another type `T` based on the
6
+ keys. The `multimap` class supports bidirectional iterators.
7
 
8
+ A `multimap` meets all of the requirements of a container
9
+ [[container.reqmts]], of a reversible container
10
+ [[container.rev.reqmts]], of an allocator-aware container
11
+ [[container.alloc.reqmts]], and of an associative container
12
+ [[associative.reqmts]]. A `multimap` also provides most operations
13
  described in  [[associative.reqmts]] for equal keys. This means that a
14
  `multimap` supports the `a_eq` operations in  [[associative.reqmts]] but
15
  not the `a_uniq` operations. For a `multimap<Key,T>` the `key_type` is
16
  `Key` and the `value_type` is `pair<const Key,T>`. Descriptions are
17
  provided here only for operations on `multimap` that are not described
 
32
  using allocator_type = Allocator;
33
  using pointer = typename allocator_traits<Allocator>::pointer;
34
  using const_pointer = typename allocator_traits<Allocator>::const_pointer;
35
  using reference = value_type&;
36
  using const_reference = const value_type&;
37
+ using size_type = implementation-defined // type of multimap::size_type; // see [container.requirements]
38
+ using difference_type = implementation-defined // type of multimap::difference_type; // see [container.requirements]
39
  using iterator = implementation-defined // type of multimap::iterator; // see [container.requirements]
40
  using const_iterator = implementation-defined // type of multimap::const_iterator; // see [container.requirements]
41
  using reverse_iterator = std::reverse_iterator<iterator>;
42
  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
43
  using node_type = unspecified;
 
45
  class value_compare {
46
  friend class multimap;
47
  protected:
48
  Compare comp;
49
  value_compare(Compare c) : comp(c) { }
50
+
51
  public:
52
  bool operator()(const value_type& x, const value_type& y) const {
53
  return comp(x.first, y.first);
54
  }
55
  };
 
59
  explicit multimap(const Compare& comp, const Allocator& = Allocator());
60
  template<class InputIterator>
61
  multimap(InputIterator first, InputIterator last,
62
  const Compare& comp = Compare(),
63
  const Allocator& = Allocator());
64
+ template<container-compatible-range<value_type> R>
65
+ multimap(from_range_t, R&& rg,
66
+ const Compare& comp = Compare(), const Allocator& = Allocator());
67
  multimap(const multimap& x);
68
  multimap(multimap&& x);
69
  explicit multimap(const Allocator&);
70
+ multimap(const multimap&, const type_identity_t<Allocator>&);
71
+ multimap(multimap&&, const type_identity_t<Allocator>&);
72
  multimap(initializer_list<value_type>,
73
  const Compare& = Compare(),
74
  const Allocator& = Allocator());
75
  template<class InputIterator>
76
  multimap(InputIterator first, InputIterator last, const Allocator& a)
77
  : multimap(first, last, Compare(), a) { }
78
+ template<container-compatible-range<value_type> R>
79
+ multimap(from_range_t, R&& rg, const Allocator& a))
80
+ : multimap(from_range, std::forward<R>(rg), Compare(), a) { }
81
  multimap(initializer_list<value_type> il, const Allocator& a)
82
  : multimap(il, Compare(), a) { }
83
  ~multimap();
84
  multimap& operator=(const multimap& x);
85
  multimap& operator=(multimap&& x)
 
118
  iterator insert(const_iterator position, const value_type& x);
119
  iterator insert(const_iterator position, value_type&& x);
120
  template<class P> iterator insert(const_iterator position, P&& x);
121
  template<class InputIterator>
122
  void insert(InputIterator first, InputIterator last);
123
+ template<container-compatible-range<value_type> R>
124
+ void insert_range(R&& rg);
125
  void insert(initializer_list<value_type>);
126
 
127
  node_type extract(const_iterator position);
128
  node_type extract(const key_type& x);
129
+ template<class K> node_type extract(K&& x);
130
  iterator insert(node_type&& nh);
131
  iterator insert(const_iterator hint, node_type&& nh);
132
 
133
  iterator erase(iterator position);
134
  iterator erase(const_iterator position);
135
  size_type erase(const key_type& x);
136
+ template<class K> size_type erase(K&& x);
137
  iterator erase(const_iterator first, const_iterator last);
138
  void swap(multimap&)
139
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
140
  is_nothrow_swappable_v<Compare>);
141
  void clear() noexcept;
 
187
  class Allocator = allocator<iter-to-alloc-type<InputIterator>>>
188
  multimap(InputIterator, InputIterator, Compare = Compare(), Allocator = Allocator())
189
  -> multimap<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>,
190
  Compare, Allocator>;
191
 
192
+ template<ranges::input_range R, class Compare = less<range-key-type<R>>,
193
+ class Allocator = allocator<range-to-alloc-type<R>>>
194
+ multimap(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
195
+ -> multimap<range-key-type<R>, range-mapped-type<R>, Compare, Allocator>;
196
+
197
  template<class Key, class T, class Compare = less<Key>,
198
  class Allocator = allocator<pair<const Key, T>>>
199
  multimap(initializer_list<pair<Key, T>>, Compare = Compare(), Allocator = Allocator())
200
  -> multimap<Key, T, Compare, Allocator>;
201
 
202
  template<class InputIterator, class Allocator>
203
  multimap(InputIterator, InputIterator, Allocator)
204
  -> multimap<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>,
205
  less<iter-key-type<InputIterator>>, Allocator>;
206
 
207
+ template<ranges::input_range R, class Allocator>
208
+ multimap(from_range_t, R&&, Allocator)
209
+ -> multimap<range-key-type<R>, range-mapped-type<R>, less<range-key-type<R>>, Allocator>;
210
+
211
  template<class Key, class T, class Allocator>
212
  multimap(initializer_list<pair<Key, T>>, Allocator)
213
  -> multimap<Key, T, less<Key>, Allocator>;
 
 
 
 
 
 
214
  }
215
  ```
216