From Jason Turner

[set]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp109b95kj/{from.md → to.md} +26 -11
tmp/tmp109b95kj/{from.md → to.md} RENAMED
@@ -40,28 +40,32 @@ namespace std {
40
  typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
41
  typedef std::reverse_iterator<iterator> reverse_iterator;
42
  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
43
 
44
  // [set.cons], construct/copy/destroy:
45
- explicit set(const Compare& comp = Compare(),
 
46
  const Allocator& = Allocator());
47
  template <class InputIterator>
48
  set(InputIterator first, InputIterator last,
49
  const Compare& comp = Compare(), const Allocator& = Allocator());
50
- set(const set<Key,Compare,Allocator>& x);
51
- set(set<Key,Compare,Allocator>&& x);
52
  explicit set(const Allocator&);
53
  set(const set&, const Allocator&);
54
  set(set&&, const Allocator&);
55
  set(initializer_list<value_type>,
56
  const Compare& = Compare(),
57
  const Allocator& = Allocator());
 
 
 
 
 
58
  ~set();
59
- set<Key,Compare,Allocator>& operator=
60
- (const set<Key,Compare,Allocator>& x);
61
- set<Key,Compare,Allocator>& operator=
62
- (set<Key,Compare,Allocator>&& x);
63
  set& operator=(initializer_list<value_type>);
64
  allocator_type get_allocator() const noexcept;
65
 
66
  // iterators:
67
  iterator begin() noexcept;
@@ -96,31 +100,42 @@ namespace std {
96
  void insert(initializer_list<value_type>);
97
 
98
  iterator erase(const_iterator position);
99
  size_type erase(const key_type& x);
100
  iterator erase(const_iterator first, const_iterator last);
101
- void swap(set<Key,Compare,Allocator>&);
102
  void clear() noexcept;
103
 
104
  // observers:
105
  key_compare key_comp() const;
106
  value_compare value_comp() const;
107
 
108
  // set operations:
109
  iterator find(const key_type& x);
110
  const_iterator find(const key_type& x) const;
 
 
111
 
112
  size_type count(const key_type& x) const;
 
113
 
114
  iterator lower_bound(const key_type& x);
115
  const_iterator lower_bound(const key_type& x) const;
 
 
116
 
117
  iterator upper_bound(const key_type& x);
118
  const_iterator upper_bound(const key_type& x) const;
 
 
119
 
120
  pair<iterator,iterator> equal_range(const key_type& x);
121
  pair<const_iterator,const_iterator> equal_range(const key_type& x) const;
 
 
 
 
122
  };
123
 
124
  template <class Key, class Compare, class Allocator>
125
  bool operator==(const set<Key,Compare,Allocator>& x,
126
  const set<Key,Compare,Allocator>& y);
@@ -148,11 +163,11 @@ namespace std {
148
  ```
149
 
150
  #### `set` constructors, copy, and assignment <a id="set.cons">[[set.cons]]</a>
151
 
152
  ``` cpp
153
- explicit set(const Compare& comp = Compare(),
154
  const Allocator& = Allocator());
155
  ```
156
 
157
  *Effects:* Constructs an empty set using the specified comparison
158
  objects and allocator.
@@ -167,12 +182,12 @@ template <class InputIterator>
167
 
168
  *Effects:* Constructs an empty `set` using the specified comparison
169
  object and allocator, and inserts elements from the range \[`first`,
170
  `last`).
171
 
172
- *Requires:* If the iterator’s dereference operator returns an lvalue or
173
- a non-const rvalue, then `Key` shall be `CopyConstructible`.
174
 
175
  *Complexity:* Linear in N if the range \[`first`, `last`) is already
176
  sorted using `comp` and otherwise N log N, where N is `last - first`.
177
 
178
  #### `set` specialized algorithms <a id="set.special">[[set.special]]</a>
 
40
  typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
41
  typedef std::reverse_iterator<iterator> reverse_iterator;
42
  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
43
 
44
  // [set.cons], construct/copy/destroy:
45
+ set() : set(Compare()) { }
46
+ explicit set(const Compare& comp,
47
  const Allocator& = Allocator());
48
  template <class InputIterator>
49
  set(InputIterator first, InputIterator last,
50
  const Compare& comp = Compare(), const Allocator& = Allocator());
51
+ set(const set& x);
52
+ set(set&& x);
53
  explicit set(const Allocator&);
54
  set(const set&, const Allocator&);
55
  set(set&&, const Allocator&);
56
  set(initializer_list<value_type>,
57
  const Compare& = Compare(),
58
  const Allocator& = Allocator());
59
+ template <class InputIterator>
60
+ set(InputIterator first, InputIterator last, const Allocator& a)
61
+ : set(first, last, Compare(), a) { }
62
+ set(initializer_list<value_type> il, const Allocator& a)
63
+ : set(il, Compare(), a) { }
64
  ~set();
65
+ set& operator=(const set& x);
66
+ set& operator=(set&& x);
 
 
67
  set& operator=(initializer_list<value_type>);
68
  allocator_type get_allocator() const noexcept;
69
 
70
  // iterators:
71
  iterator begin() noexcept;
 
100
  void insert(initializer_list<value_type>);
101
 
102
  iterator erase(const_iterator position);
103
  size_type erase(const key_type& x);
104
  iterator erase(const_iterator first, const_iterator last);
105
+ void swap(set&);
106
  void clear() noexcept;
107
 
108
  // observers:
109
  key_compare key_comp() const;
110
  value_compare value_comp() const;
111
 
112
  // set operations:
113
  iterator find(const key_type& x);
114
  const_iterator find(const key_type& x) const;
115
+ template <class K> iterator find(const K& x);
116
+ template <class K> const_iterator find(const K& x) const;
117
 
118
  size_type count(const key_type& x) const;
119
+ template <class K> size_type count(const K& x) const;
120
 
121
  iterator lower_bound(const key_type& x);
122
  const_iterator lower_bound(const key_type& x) const;
123
+ template <class K> iterator lower_bound(const K& x);
124
+ template <class K> const_iterator lower_bound(const K& x) const;
125
 
126
  iterator upper_bound(const key_type& x);
127
  const_iterator upper_bound(const key_type& x) const;
128
+ template <class K> iterator upper_bound(const K& x);
129
+ template <class K> const_iterator upper_bound(const K& x) const;
130
 
131
  pair<iterator,iterator> equal_range(const key_type& x);
132
  pair<const_iterator,const_iterator> equal_range(const key_type& x) const;
133
+ template <class K>
134
+ pair<iterator, iterator> equal_range(const K& x);
135
+ template <class K>
136
+ pair<const_iterator, const_iterator> equal_range(const K& x) const;
137
  };
138
 
139
  template <class Key, class Compare, class Allocator>
140
  bool operator==(const set<Key,Compare,Allocator>& x,
141
  const set<Key,Compare,Allocator>& y);
 
163
  ```
164
 
165
  #### `set` constructors, copy, and assignment <a id="set.cons">[[set.cons]]</a>
166
 
167
  ``` cpp
168
+ explicit set(const Compare& comp,
169
  const Allocator& = Allocator());
170
  ```
171
 
172
  *Effects:* Constructs an empty set using the specified comparison
173
  objects and allocator.
 
182
 
183
  *Effects:* Constructs an empty `set` using the specified comparison
184
  object and allocator, and inserts elements from the range \[`first`,
185
  `last`).
186
 
187
+ *Requires:* If the iterator’s indirection operator returns an lvalue or
188
+ a non-const rvalue, then `Key` shall be `CopyInsertable` into `*this`.
189
 
190
  *Complexity:* Linear in N if the range \[`first`, `last`) is already
191
  sorted using `comp` and otherwise N log N, where N is `last - first`.
192
 
193
  #### `set` specialized algorithms <a id="set.special">[[set.special]]</a>