From Jason Turner

[unord.set]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp1hpg5rdk/{from.md → to.md} +31 -13
tmp/tmp1hpg5rdk/{from.md → to.md} RENAMED
@@ -34,24 +34,25 @@ namespace std {
34
  typedef Key key_type;
35
  typedef Key value_type;
36
  typedef Hash hasher;
37
  typedef Pred key_equal;
38
  typedef Allocator allocator_type;
39
- typedef typename allocator_type::pointer pointer;
40
- typedef typename allocator_type::const_pointer const_pointer;
41
- typedef typename allocator_type::reference reference;
42
- typedef typename allocator_type::const_reference const_reference;
43
  typedef implementation-defined size_type;
44
  typedef implementation-defined difference_type;
45
 
46
  typedef implementation-defined iterator;
47
  typedef implementation-defined const_iterator;
48
  typedef implementation-defined local_iterator;
49
  typedef implementation-defined const_local_iterator;
50
 
51
  // construct/destroy/copy
52
- explicit unordered_set(size_type n = see below,
 
53
  const hasher& hf = hasher(),
54
  const key_equal& eql = key_equal(),
55
  const allocator_type& a = allocator_type());
56
  template <class InputIterator>
57
  unordered_set(InputIterator f, InputIterator l,
@@ -67,10 +68,26 @@ namespace std {
67
  unordered_set(initializer_list<value_type>,
68
  size_type = see below,
69
  const hasher& hf = hasher(),
70
  const key_equal& eql = key_equal(),
71
  const allocator_type& a = allocator_type());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  ~unordered_set();
73
  unordered_set& operator=(const unordered_set&);
74
  unordered_set& operator=(unordered_set&&);
75
  unordered_set& operator=(initializer_list<value_type>);
76
  allocator_type get_allocator() const noexcept;
@@ -138,31 +155,32 @@ namespace std {
138
 
139
  template <class Key, class Hash, class Pred, class Alloc>
140
  void swap(unordered_set<Key, Hash, Pred, Alloc>& x,
141
  unordered_set<Key, Hash, Pred, Alloc>& y);
142
 
143
- template <class Key, class T, class Hash, class Pred, class Alloc>
144
- bool operator==(const unordered_set<Key, T, Hash, Pred, Alloc>& a,
145
- const unordered_set<Key, T, Hash, Pred, Alloc>& b);
146
- template <class Key, class T, class Hash, class Pred, class Alloc>
147
- bool operator!=(const unordered_set<Key, T, Hash, Pred, Alloc>& a,
148
- const unordered_set<Key, T, Hash, Pred, Alloc>& b);
149
  }
150
  ```
151
 
152
  #### `unordered_set` constructors <a id="unord.set.cnstr">[[unord.set.cnstr]]</a>
153
 
154
  ``` cpp
155
- explicit unordered_set(size_type n = see below,
 
156
  const hasher& hf = hasher(),
157
  const key_equal& eql = key_equal(),
158
  const allocator_type& a = allocator_type());
159
  ```
160
 
161
  *Effects:* Constructs an empty `unordered_set` using the specified hash
162
  function, key equality function, and allocator, and using at least *`n`*
163
- buckets. If *`n`* is not provided, the number of buckets is
164
  *implementation-defined*. `max_load_factor()` returns 1.0.
165
 
166
  *Complexity:* Constant.
167
 
168
  ``` cpp
 
34
  typedef Key key_type;
35
  typedef Key value_type;
36
  typedef Hash hasher;
37
  typedef Pred key_equal;
38
  typedef Allocator allocator_type;
39
+ typedef typename allocator_traits<Allocator>::pointer pointer;
40
+ typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
41
+ typedef value_type& reference;
42
+ typedef const value_type& const_reference;
43
  typedef implementation-defined size_type;
44
  typedef implementation-defined difference_type;
45
 
46
  typedef implementation-defined iterator;
47
  typedef implementation-defined const_iterator;
48
  typedef implementation-defined local_iterator;
49
  typedef implementation-defined const_local_iterator;
50
 
51
  // construct/destroy/copy
52
+ unordered_set();
53
+ explicit unordered_set(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_set(InputIterator f, InputIterator l,
 
68
  unordered_set(initializer_list<value_type>,
69
  size_type = see below,
70
  const hasher& hf = hasher(),
71
  const key_equal& eql = key_equal(),
72
  const allocator_type& a = allocator_type());
73
+ unordered_set(size_type n, const allocator_type& a)
74
+ : unordered_set(n, hasher(), key_equal(), a) { }
75
+ unordered_set(size_type n, const hasher& hf, const allocator_type& a)
76
+ : unordered_set(n, hf, key_equal(), a) { }
77
+ template <class InputIterator>
78
+ unordered_set(InputIterator f, InputIterator l, size_type n, const allocator_type& a)
79
+ : unordered_set(f, l, n, hasher(), key_equal(), a) { }
80
+ template <class InputIterator>
81
+ unordered_set(InputIterator f, InputIterator l, size_type n, const hasher& hf,
82
+ const allocator_type& a)
83
+ : unordered_set(f, l, n, hf, key_equal(), a) { }
84
+ unordered_set(initializer_list<value_type> il, size_type n, const allocator_type& a)
85
+ : unordered_set(il, n, hasher(), key_equal(), a) { }
86
+ unordered_set(initializer_list<value_type> il, size_type n, const hasher& hf,
87
+ const allocator_type& a)
88
+ : unordered_set(il, n, hf, key_equal(), a) { }
89
  ~unordered_set();
90
  unordered_set& operator=(const unordered_set&);
91
  unordered_set& operator=(unordered_set&&);
92
  unordered_set& operator=(initializer_list<value_type>);
93
  allocator_type get_allocator() const noexcept;
 
155
 
156
  template <class Key, class Hash, class Pred, class Alloc>
157
  void swap(unordered_set<Key, Hash, Pred, Alloc>& x,
158
  unordered_set<Key, Hash, Pred, Alloc>& y);
159
 
160
+ template <class Key, class Hash, class Pred, class Alloc>
161
+ bool operator==(const unordered_set<Key, Hash, Pred, Alloc>& a,
162
+ const unordered_set<Key, Hash, Pred, Alloc>& b);
163
+ template <class Key, class Hash, class Pred, class Alloc>
164
+ bool operator!=(const unordered_set<Key, Hash, Pred, Alloc>& a,
165
+ const unordered_set<Key, Hash, Pred, Alloc>& b);
166
  }
167
  ```
168
 
169
  #### `unordered_set` constructors <a id="unord.set.cnstr">[[unord.set.cnstr]]</a>
170
 
171
  ``` cpp
172
+ unordered_set() : unordered_set(size_type(see below)) { }
173
+ explicit unordered_set(size_type n,
174
  const hasher& hf = hasher(),
175
  const key_equal& eql = key_equal(),
176
  const allocator_type& a = allocator_type());
177
  ```
178
 
179
  *Effects:* Constructs an empty `unordered_set` using the specified hash
180
  function, key equality function, and allocator, and using at least *`n`*
181
+ buckets. For the default constructor, the number of buckets is
182
  *implementation-defined*. `max_load_factor()` returns 1.0.
183
 
184
  *Complexity:* Constant.
185
 
186
  ``` cpp