blob: 2798a618a830fffa1830d013740ace9621c4820f [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001// -*- C++ -*-
2//===-------------------------- unordered_set -----------------------------===//
3//
Howard Hinnantf5256e12010-05-11 21:36:01 +00004// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00005//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00006// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00008//
9//===----------------------------------------------------------------------===//
10
11#ifndef _LIBCPP_UNORDERED_SET
12#define _LIBCPP_UNORDERED_SET
13
14/*
15
16 unordered_set synopsis
17
18#include <initializer_list>
19
20namespace std
21{
22
23template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
24 class Alloc = allocator<Value>>
25class unordered_set
26{
27public:
28 // types
29 typedef Value key_type;
30 typedef key_type value_type;
31 typedef Hash hasher;
32 typedef Pred key_equal;
33 typedef Alloc allocator_type;
34 typedef value_type& reference;
35 typedef const value_type& const_reference;
36 typedef typename allocator_traits<allocator_type>::pointer pointer;
37 typedef typename allocator_traits<allocator_type>::const_pointer const_pointer;
38 typedef typename allocator_traits<allocator_type>::size_type size_type;
39 typedef typename allocator_traits<allocator_type>::difference_type difference_type;
40
41 typedef /unspecified/ iterator;
42 typedef /unspecified/ const_iterator;
43 typedef /unspecified/ local_iterator;
44 typedef /unspecified/ const_local_iterator;
45
Howard Hinnant04dae1d2011-06-04 20:18:37 +000046 unordered_set()
47 noexcept(
48 is_nothrow_default_constructible<hasher>::value &&
49 is_nothrow_default_constructible<key_equal>::value &&
50 is_nothrow_default_constructible<allocator_type>::value);
51 explicit unordered_set(size_type n, const hasher& hf = hasher(),
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000052 const key_equal& eql = key_equal(),
53 const allocator_type& a = allocator_type());
54 template <class InputIterator>
55 unordered_set(InputIterator f, InputIterator l,
56 size_type n = 0, const hasher& hf = hasher(),
57 const key_equal& eql = key_equal(),
58 const allocator_type& a = allocator_type());
59 explicit unordered_set(const allocator_type&);
60 unordered_set(const unordered_set&);
61 unordered_set(const unordered_set&, const Allocator&);
Howard Hinnant04dae1d2011-06-04 20:18:37 +000062 unordered_set(unordered_set&&)
63 noexcept(
64 is_nothrow_move_constructible<hasher>::value &&
65 is_nothrow_move_constructible<key_equal>::value &&
66 is_nothrow_move_constructible<allocator_type>::value);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000067 unordered_set(unordered_set&&, const Allocator&);
68 unordered_set(initializer_list<value_type>, size_type n = 0,
69 const hasher& hf = hasher(), const key_equal& eql = key_equal(),
70 const allocator_type& a = allocator_type());
71 ~unordered_set();
72 unordered_set& operator=(const unordered_set&);
Howard Hinnant04dae1d2011-06-04 20:18:37 +000073 unordered_set& operator=(unordered_set&&)
74 noexcept(
75 allocator_type::propagate_on_container_move_assignment::value &&
76 is_nothrow_move_assignable<allocator_type>::value &&
77 is_nothrow_move_assignable<hasher>::value &&
78 is_nothrow_move_assignable<key_equal>::value);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000079 unordered_set& operator=(initializer_list<value_type>);
80
Howard Hinnant04dae1d2011-06-04 20:18:37 +000081 allocator_type get_allocator() const noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000082
Howard Hinnant04dae1d2011-06-04 20:18:37 +000083 bool empty() const noexcept;
84 size_type size() const noexcept;
85 size_type max_size() const noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000086
Howard Hinnant04dae1d2011-06-04 20:18:37 +000087 iterator begin() noexcept;
88 iterator end() noexcept;
89 const_iterator begin() const noexcept;
90 const_iterator end() const noexcept;
91 const_iterator cbegin() const noexcept;
92 const_iterator cend() const noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000093
94 template <class... Args>
95 pair<iterator, bool> emplace(Args&&... args);
96 template <class... Args>
97 iterator emplace_hint(const_iterator position, Args&&... args);
98 pair<iterator, bool> insert(const value_type& obj);
99 pair<iterator, bool> insert(value_type&& obj);
100 iterator insert(const_iterator hint, const value_type& obj);
101 iterator insert(const_iterator hint, value_type&& obj);
102 template <class InputIterator>
103 void insert(InputIterator first, InputIterator last);
104 void insert(initializer_list<value_type>);
105
106 iterator erase(const_iterator position);
107 size_type erase(const key_type& k);
108 iterator erase(const_iterator first, const_iterator last);
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000109 void clear() noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000110
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000111 void swap(unordered_set&)
112 noexcept(
113 (!allocator_type::propagate_on_container_swap::value ||
114 __is_nothrow_swappable<allocator_type>::value) &&
115 __is_nothrow_swappable<hasher>::value &&
116 __is_nothrow_swappable<key_equal>::value);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000117
118 hasher hash_function() const;
119 key_equal key_eq() const;
120
121 iterator find(const key_type& k);
122 const_iterator find(const key_type& k) const;
123 size_type count(const key_type& k) const;
124 pair<iterator, iterator> equal_range(const key_type& k);
125 pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
126
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000127 size_type bucket_count() const noexcept;
128 size_type max_bucket_count() const noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000129
130 size_type bucket_size(size_type n) const;
131 size_type bucket(const key_type& k) const;
132
133 local_iterator begin(size_type n);
134 local_iterator end(size_type n);
135 const_local_iterator begin(size_type n) const;
136 const_local_iterator end(size_type n) const;
137 const_local_iterator cbegin(size_type n) const;
138 const_local_iterator cend(size_type n) const;
139
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000140 float load_factor() const noexcept;
141 float max_load_factor() const noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000142 void max_load_factor(float z);
143 void rehash(size_type n);
144 void reserve(size_type n);
145};
146
147template <class Value, class Hash, class Pred, class Alloc>
148 void swap(unordered_set<Value, Hash, Pred, Alloc>& x,
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000149 unordered_set<Value, Hash, Pred, Alloc>& y)
150 noexcept(noexcept(x.swap(y)));
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000151
152template <class Value, class Hash, class Pred, class Alloc>
153 bool
154 operator==(const unordered_set<Value, Hash, Pred, Alloc>& x,
155 const unordered_set<Value, Hash, Pred, Alloc>& y);
156
157template <class Value, class Hash, class Pred, class Alloc>
158 bool
159 operator!=(const unordered_set<Value, Hash, Pred, Alloc>& x,
160 const unordered_set<Value, Hash, Pred, Alloc>& y);
161
162template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
163 class Alloc = allocator<Value>>
164class unordered_multiset
165{
166public:
167 // types
168 typedef Value key_type;
169 typedef key_type value_type;
170 typedef Hash hasher;
171 typedef Pred key_equal;
172 typedef Alloc allocator_type;
173 typedef value_type& reference;
174 typedef const value_type& const_reference;
175 typedef typename allocator_traits<allocator_type>::pointer pointer;
176 typedef typename allocator_traits<allocator_type>::const_pointer const_pointer;
177 typedef typename allocator_traits<allocator_type>::size_type size_type;
178 typedef typename allocator_traits<allocator_type>::difference_type difference_type;
179
180 typedef /unspecified/ iterator;
181 typedef /unspecified/ const_iterator;
182 typedef /unspecified/ local_iterator;
183 typedef /unspecified/ const_local_iterator;
184
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000185 unordered_multiset()
186 noexcept(
187 is_nothrow_default_constructible<hasher>::value &&
188 is_nothrow_default_constructible<key_equal>::value &&
189 is_nothrow_default_constructible<allocator_type>::value);
190 explicit unordered_multiset(size_type n, const hasher& hf = hasher(),
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000191 const key_equal& eql = key_equal(),
192 const allocator_type& a = allocator_type());
193 template <class InputIterator>
194 unordered_multiset(InputIterator f, InputIterator l,
195 size_type n = 0, const hasher& hf = hasher(),
196 const key_equal& eql = key_equal(),
197 const allocator_type& a = allocator_type());
198 explicit unordered_multiset(const allocator_type&);
199 unordered_multiset(const unordered_multiset&);
200 unordered_multiset(const unordered_multiset&, const Allocator&);
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000201 unordered_multiset(unordered_multiset&&)
202 noexcept(
203 is_nothrow_move_constructible<hasher>::value &&
204 is_nothrow_move_constructible<key_equal>::value &&
205 is_nothrow_move_constructible<allocator_type>::value);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000206 unordered_multiset(unordered_multiset&&, const Allocator&);
207 unordered_multiset(initializer_list<value_type>, size_type n = /see below/,
208 const hasher& hf = hasher(), const key_equal& eql = key_equal(),
209 const allocator_type& a = allocator_type());
210 ~unordered_multiset();
211 unordered_multiset& operator=(const unordered_multiset&);
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000212 unordered_multiset& operator=(unordered_multiset&&)
213 noexcept(
214 allocator_type::propagate_on_container_move_assignment::value &&
215 is_nothrow_move_assignable<allocator_type>::value &&
216 is_nothrow_move_assignable<hasher>::value &&
217 is_nothrow_move_assignable<key_equal>::value);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000218 unordered_multiset& operator=(initializer_list<value_type>);
219
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000220 allocator_type get_allocator() const noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000221
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000222 bool empty() const noexcept;
223 size_type size() const noexcept;
224 size_type max_size() const noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000225
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000226 iterator begin() noexcept;
227 iterator end() noexcept;
228 const_iterator begin() const noexcept;
229 const_iterator end() const noexcept;
230 const_iterator cbegin() const noexcept;
231 const_iterator cend() const noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000232
233 template <class... Args>
234 iterator emplace(Args&&... args);
235 template <class... Args>
236 iterator emplace_hint(const_iterator position, Args&&... args);
237 iterator insert(const value_type& obj);
238 iterator insert(value_type&& obj);
239 iterator insert(const_iterator hint, const value_type& obj);
240 iterator insert(const_iterator hint, value_type&& obj);
241 template <class InputIterator>
242 void insert(InputIterator first, InputIterator last);
243 void insert(initializer_list<value_type>);
244
245 iterator erase(const_iterator position);
246 size_type erase(const key_type& k);
247 iterator erase(const_iterator first, const_iterator last);
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000248 void clear() noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000249
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000250 void swap(unordered_multiset&)
251 noexcept(
252 (!allocator_type::propagate_on_container_swap::value ||
253 __is_nothrow_swappable<allocator_type>::value) &&
254 __is_nothrow_swappable<hasher>::value &&
255 __is_nothrow_swappable<key_equal>::value);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000256
257 hasher hash_function() const;
258 key_equal key_eq() const;
259
260 iterator find(const key_type& k);
261 const_iterator find(const key_type& k) const;
262 size_type count(const key_type& k) const;
263 pair<iterator, iterator> equal_range(const key_type& k);
264 pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
265
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000266 size_type bucket_count() const noexcept;
267 size_type max_bucket_count() const noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000268
269 size_type bucket_size(size_type n) const;
270 size_type bucket(const key_type& k) const;
271
272 local_iterator begin(size_type n);
273 local_iterator end(size_type n);
274 const_local_iterator begin(size_type n) const;
275 const_local_iterator end(size_type n) const;
276 const_local_iterator cbegin(size_type n) const;
277 const_local_iterator cend(size_type n) const;
278
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000279 float load_factor() const noexcept;
280 float max_load_factor() const noexcept;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000281 void max_load_factor(float z);
282 void rehash(size_type n);
283 void reserve(size_type n);
284};
285
286template <class Value, class Hash, class Pred, class Alloc>
287 void swap(unordered_multiset<Value, Hash, Pred, Alloc>& x,
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000288 unordered_multiset<Value, Hash, Pred, Alloc>& y)
289 noexcept(noexcept(x.swap(y)));
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000290
291template <class Value, class Hash, class Pred, class Alloc>
292 bool
293 operator==(const unordered_multiset<Value, Hash, Pred, Alloc>& x,
294 const unordered_multiset<Value, Hash, Pred, Alloc>& y);
295
296template <class Value, class Hash, class Pred, class Alloc>
297 bool
298 operator!=(const unordered_multiset<Value, Hash, Pred, Alloc>& x,
299 const unordered_multiset<Value, Hash, Pred, Alloc>& y);
300} // std
301
302*/
303
304#include <__config>
305#include <__hash_table>
306#include <functional>
307
308#pragma GCC system_header
309
310_LIBCPP_BEGIN_NAMESPACE_STD
311
312template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
313 class _Alloc = allocator<_Value> >
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000314class _LIBCPP_VISIBLE unordered_set
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000315{
316public:
317 // types
318 typedef _Value key_type;
319 typedef key_type value_type;
320 typedef _Hash hasher;
321 typedef _Pred key_equal;
322 typedef _Alloc allocator_type;
323 typedef value_type& reference;
324 typedef const value_type& const_reference;
325
326private:
327 typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table;
328
329 __table __table_;
330
331public:
332 typedef typename __table::pointer pointer;
333 typedef typename __table::const_pointer const_pointer;
334 typedef typename __table::size_type size_type;
335 typedef typename __table::difference_type difference_type;
336
337 typedef typename __table::const_iterator iterator;
338 typedef typename __table::const_iterator const_iterator;
339 typedef typename __table::const_local_iterator local_iterator;
340 typedef typename __table::const_local_iterator const_local_iterator;
341
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000342 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000343 unordered_set()
344 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
345 {} // = default;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000346 explicit unordered_set(size_type __n, const hasher& __hf = hasher(),
347 const key_equal& __eql = key_equal());
348 unordered_set(size_type __n, const hasher& __hf, const key_equal& __eql,
349 const allocator_type& __a);
350 template <class _InputIterator>
351 unordered_set(_InputIterator __first, _InputIterator __last);
352 template <class _InputIterator>
353 unordered_set(_InputIterator __first, _InputIterator __last,
354 size_type __n, const hasher& __hf = hasher(),
355 const key_equal& __eql = key_equal());
356 template <class _InputIterator>
357 unordered_set(_InputIterator __first, _InputIterator __last,
358 size_type __n, const hasher& __hf, const key_equal& __eql,
359 const allocator_type& __a);
360 explicit unordered_set(const allocator_type& __a);
361 unordered_set(const unordered_set& __u);
362 unordered_set(const unordered_set& __u, const allocator_type& __a);
Howard Hinnant73d21a42010-09-04 23:28:19 +0000363#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000364 unordered_set(unordered_set&& __u)
365 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000366 unordered_set(unordered_set&& __u, const allocator_type& __a);
Howard Hinnant73d21a42010-09-04 23:28:19 +0000367#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000368 unordered_set(initializer_list<value_type> __il);
369 unordered_set(initializer_list<value_type> __il, size_type __n,
370 const hasher& __hf = hasher(),
371 const key_equal& __eql = key_equal());
372 unordered_set(initializer_list<value_type> __il, size_type __n,
373 const hasher& __hf, const key_equal& __eql,
374 const allocator_type& __a);
375 // ~unordered_set() = default;
376 // unordered_set& operator=(const unordered_set& __u) = default;
Howard Hinnant73d21a42010-09-04 23:28:19 +0000377#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000378 unordered_set& operator=(unordered_set&& __u)
379 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000380#endif
381 unordered_set& operator=(initializer_list<value_type> __il);
382
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000383 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000384 allocator_type get_allocator() const _NOEXCEPT
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000385 {return allocator_type(__table_.__node_alloc());}
386
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000387 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000388 bool empty() const _NOEXCEPT {return __table_.size() == 0;}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000389 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000390 size_type size() const _NOEXCEPT {return __table_.size();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000391 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000392 size_type max_size() const _NOEXCEPT {return __table_.max_size();}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000393
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000394 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000395 iterator begin() _NOEXCEPT {return __table_.begin();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000396 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000397 iterator end() _NOEXCEPT {return __table_.end();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000398 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000399 const_iterator begin() const _NOEXCEPT {return __table_.begin();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000400 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000401 const_iterator end() const _NOEXCEPT {return __table_.end();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000402 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000403 const_iterator cbegin() const _NOEXCEPT {return __table_.begin();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000404 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000405 const_iterator cend() const _NOEXCEPT {return __table_.end();}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000406
Howard Hinnant73d21a42010-09-04 23:28:19 +0000407#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000408 template <class... _Args>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000409 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000410 pair<iterator, bool> emplace(_Args&&... __args)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000411 {return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000412 template <class... _Args>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000413 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000414 iterator emplace_hint(const_iterator, _Args&&... __args)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000415 {return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;}
Howard Hinnant73d21a42010-09-04 23:28:19 +0000416#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000417 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000418 pair<iterator, bool> insert(const value_type& __x)
419 {return __table_.__insert_unique(__x);}
Howard Hinnant73d21a42010-09-04 23:28:19 +0000420#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000421 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000422 pair<iterator, bool> insert(value_type&& __x)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000423 {return __table_.__insert_unique(_VSTD::move(__x));}
Howard Hinnant73d21a42010-09-04 23:28:19 +0000424#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000425 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000426 iterator insert(const_iterator, const value_type& __x)
427 {return insert(__x).first;}
Howard Hinnant73d21a42010-09-04 23:28:19 +0000428#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000429 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000430 iterator insert(const_iterator, value_type&& __x)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000431 {return insert(_VSTD::move(__x)).first;}
Howard Hinnant73d21a42010-09-04 23:28:19 +0000432#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000433 template <class _InputIterator>
434 void insert(_InputIterator __first, _InputIterator __last);
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000435 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000436 void insert(initializer_list<value_type> __il)
437 {insert(__il.begin(), __il.end());}
438
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000439 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000440 iterator erase(const_iterator __p) {return __table_.erase(__p);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000441 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000442 size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000443 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000444 iterator erase(const_iterator __first, const_iterator __last)
445 {return __table_.erase(__first, __last);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000446 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000447 void clear() _NOEXCEPT {__table_.clear();}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000448
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000449 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000450 void swap(unordered_set& __u)
451 _NOEXCEPT_(__is_nothrow_swappable<__table>::value)
452 {__table_.swap(__u.__table_);}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000453
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000454 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000455 hasher hash_function() const {return __table_.hash_function();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000456 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000457 key_equal key_eq() const {return __table_.key_eq();}
458
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000459 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000460 iterator find(const key_type& __k) {return __table_.find(__k);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000461 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000462 const_iterator find(const key_type& __k) const {return __table_.find(__k);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000463 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000464 size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000465 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000466 pair<iterator, iterator> equal_range(const key_type& __k)
467 {return __table_.__equal_range_unique(__k);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000468 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000469 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
470 {return __table_.__equal_range_unique(__k);}
471
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000472 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000473 size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000474 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000475 size_type max_bucket_count() const _NOEXCEPT {return __table_.max_bucket_count();}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000476
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000477 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000478 size_type bucket_size(size_type __n) const {return __table_.bucket_size(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000479 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000480 size_type bucket(const key_type& __k) const {return __table_.bucket(__k);}
481
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000482 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000483 local_iterator begin(size_type __n) {return __table_.begin(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000484 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000485 local_iterator end(size_type __n) {return __table_.end(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000486 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000487 const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000488 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000489 const_local_iterator end(size_type __n) const {return __table_.cend(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000490 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000491 const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000492 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000493 const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
494
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000495 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000496 float load_factor() const _NOEXCEPT {return __table_.load_factor();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000497 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000498 float max_load_factor() const _NOEXCEPT {return __table_.max_load_factor();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000499 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000500 void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000501 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000502 void rehash(size_type __n) {__table_.rehash(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000503 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000504 void reserve(size_type __n) {__table_.reserve(__n);}
505};
506
507template <class _Value, class _Hash, class _Pred, class _Alloc>
508unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n,
509 const hasher& __hf, const key_equal& __eql)
510 : __table_(__hf, __eql)
511{
512 __table_.rehash(__n);
513}
514
515template <class _Value, class _Hash, class _Pred, class _Alloc>
516unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n,
517 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
518 : __table_(__hf, __eql, __a)
519{
520 __table_.rehash(__n);
521}
522
523template <class _Value, class _Hash, class _Pred, class _Alloc>
524template <class _InputIterator>
525unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
526 _InputIterator __first, _InputIterator __last)
527{
528 insert(__first, __last);
529}
530
531template <class _Value, class _Hash, class _Pred, class _Alloc>
532template <class _InputIterator>
533unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
534 _InputIterator __first, _InputIterator __last, size_type __n,
535 const hasher& __hf, const key_equal& __eql)
536 : __table_(__hf, __eql)
537{
538 __table_.rehash(__n);
539 insert(__first, __last);
540}
541
542template <class _Value, class _Hash, class _Pred, class _Alloc>
543template <class _InputIterator>
544unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
545 _InputIterator __first, _InputIterator __last, size_type __n,
546 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
547 : __table_(__hf, __eql, __a)
548{
549 __table_.rehash(__n);
550 insert(__first, __last);
551}
552
553template <class _Value, class _Hash, class _Pred, class _Alloc>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000554inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000555unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
556 const allocator_type& __a)
557 : __table_(__a)
558{
559}
560
561template <class _Value, class _Hash, class _Pred, class _Alloc>
562unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
563 const unordered_set& __u)
564 : __table_(__u.__table_)
565{
566 __table_.rehash(__u.bucket_count());
567 insert(__u.begin(), __u.end());
568}
569
570template <class _Value, class _Hash, class _Pred, class _Alloc>
571unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
572 const unordered_set& __u, const allocator_type& __a)
573 : __table_(__u.__table_, __a)
574{
575 __table_.rehash(__u.bucket_count());
576 insert(__u.begin(), __u.end());
577}
578
Howard Hinnant73d21a42010-09-04 23:28:19 +0000579#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000580
581template <class _Value, class _Hash, class _Pred, class _Alloc>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000582inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000583unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
584 unordered_set&& __u)
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000585 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000586 : __table_(_VSTD::move(__u.__table_))
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000587{
588}
589
590template <class _Value, class _Hash, class _Pred, class _Alloc>
591unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
592 unordered_set&& __u, const allocator_type& __a)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000593 : __table_(_VSTD::move(__u.__table_), __a)
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000594{
595 if (__a != __u.get_allocator())
596 {
597 iterator __i = __u.begin();
598 while (__u.size() != 0)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000599 __table_.__insert_unique(_VSTD::move(__u.__table_.remove(__i++)->__value_));
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000600 }
601}
602
Howard Hinnant73d21a42010-09-04 23:28:19 +0000603#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000604
605template <class _Value, class _Hash, class _Pred, class _Alloc>
606unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
607 initializer_list<value_type> __il)
608{
609 insert(__il.begin(), __il.end());
610}
611
612template <class _Value, class _Hash, class _Pred, class _Alloc>
613unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
614 initializer_list<value_type> __il, size_type __n, const hasher& __hf,
615 const key_equal& __eql)
616 : __table_(__hf, __eql)
617{
618 __table_.rehash(__n);
619 insert(__il.begin(), __il.end());
620}
621
622template <class _Value, class _Hash, class _Pred, class _Alloc>
623unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
624 initializer_list<value_type> __il, size_type __n, const hasher& __hf,
625 const key_equal& __eql, const allocator_type& __a)
626 : __table_(__hf, __eql, __a)
627{
628 __table_.rehash(__n);
629 insert(__il.begin(), __il.end());
630}
631
Howard Hinnant73d21a42010-09-04 23:28:19 +0000632#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000633
634template <class _Value, class _Hash, class _Pred, class _Alloc>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000635inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000636unordered_set<_Value, _Hash, _Pred, _Alloc>&
637unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000638 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000639{
Howard Hinnant0949eed2011-06-30 21:18:19 +0000640 __table_ = _VSTD::move(__u.__table_);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000641 return *this;
642}
643
Howard Hinnant73d21a42010-09-04 23:28:19 +0000644#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000645
646template <class _Value, class _Hash, class _Pred, class _Alloc>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000647inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000648unordered_set<_Value, _Hash, _Pred, _Alloc>&
649unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(
650 initializer_list<value_type> __il)
651{
652 __table_.__assign_unique(__il.begin(), __il.end());
653 return *this;
654}
655
656template <class _Value, class _Hash, class _Pred, class _Alloc>
657template <class _InputIterator>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000658inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000659void
660unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
661 _InputIterator __last)
662{
663 for (; __first != __last; ++__first)
664 __table_.__insert_unique(*__first);
665}
666
667template <class _Value, class _Hash, class _Pred, class _Alloc>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000668inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000669void
670swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
671 unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000672 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000673{
674 __x.swap(__y);
675}
676
677template <class _Value, class _Hash, class _Pred, class _Alloc>
678bool
679operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
680 const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
681{
682 if (__x.size() != __y.size())
683 return false;
684 typedef typename unordered_set<_Value, _Hash, _Pred, _Alloc>::const_iterator
685 const_iterator;
686 for (const_iterator __i = __x.begin(), __ex = __x.end(), __ey = __y.end();
687 __i != __ex; ++__i)
688 {
689 const_iterator __j = __y.find(*__i);
690 if (__j == __ey || !(*__i == *__j))
691 return false;
692 }
693 return true;
694}
695
696template <class _Value, class _Hash, class _Pred, class _Alloc>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000697inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000698bool
699operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
700 const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
701{
702 return !(__x == __y);
703}
704
705template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
706 class _Alloc = allocator<_Value> >
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000707class _LIBCPP_VISIBLE unordered_multiset
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000708{
709public:
710 // types
711 typedef _Value key_type;
712 typedef key_type value_type;
713 typedef _Hash hasher;
714 typedef _Pred key_equal;
715 typedef _Alloc allocator_type;
716 typedef value_type& reference;
717 typedef const value_type& const_reference;
718
719private:
720 typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table;
721
722 __table __table_;
723
724public:
725 typedef typename __table::pointer pointer;
726 typedef typename __table::const_pointer const_pointer;
727 typedef typename __table::size_type size_type;
728 typedef typename __table::difference_type difference_type;
729
730 typedef typename __table::const_iterator iterator;
731 typedef typename __table::const_iterator const_iterator;
732 typedef typename __table::const_local_iterator local_iterator;
733 typedef typename __table::const_local_iterator const_local_iterator;
734
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000735 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000736 unordered_multiset()
737 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
738 {} // = default
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000739 explicit unordered_multiset(size_type __n, const hasher& __hf = hasher(),
740 const key_equal& __eql = key_equal());
741 unordered_multiset(size_type __n, const hasher& __hf,
742 const key_equal& __eql, const allocator_type& __a);
743 template <class _InputIterator>
744 unordered_multiset(_InputIterator __first, _InputIterator __last);
745 template <class _InputIterator>
746 unordered_multiset(_InputIterator __first, _InputIterator __last,
747 size_type __n, const hasher& __hf = hasher(),
748 const key_equal& __eql = key_equal());
749 template <class _InputIterator>
750 unordered_multiset(_InputIterator __first, _InputIterator __last,
751 size_type __n , const hasher& __hf,
752 const key_equal& __eql, const allocator_type& __a);
753 explicit unordered_multiset(const allocator_type& __a);
754 unordered_multiset(const unordered_multiset& __u);
755 unordered_multiset(const unordered_multiset& __u, const allocator_type& __a);
Howard Hinnant73d21a42010-09-04 23:28:19 +0000756#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000757 unordered_multiset(unordered_multiset&& __u)
758 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000759 unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);
Howard Hinnant73d21a42010-09-04 23:28:19 +0000760#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000761 unordered_multiset(initializer_list<value_type> __il);
762 unordered_multiset(initializer_list<value_type> __il, size_type __n,
763 const hasher& __hf = hasher(),
764 const key_equal& __eql = key_equal());
765 unordered_multiset(initializer_list<value_type> __il, size_type __n,
766 const hasher& __hf, const key_equal& __eql,
767 const allocator_type& __a);
768 // ~unordered_multiset() = default;
769 // unordered_multiset& operator=(const unordered_multiset& __u) = default;
Howard Hinnant73d21a42010-09-04 23:28:19 +0000770#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000771 unordered_multiset& operator=(unordered_multiset&& __u)
772 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000773#endif
774 unordered_multiset& operator=(initializer_list<value_type> __il);
775
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000776 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000777 allocator_type get_allocator() const _NOEXCEPT
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000778 {return allocator_type(__table_.__node_alloc());}
779
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000780 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000781 bool empty() const _NOEXCEPT {return __table_.size() == 0;}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000782 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000783 size_type size() const _NOEXCEPT {return __table_.size();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000784 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000785 size_type max_size() const _NOEXCEPT {return __table_.max_size();}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000786
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000787 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000788 iterator begin() _NOEXCEPT {return __table_.begin();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000789 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000790 iterator end() _NOEXCEPT {return __table_.end();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000791 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000792 const_iterator begin() const _NOEXCEPT {return __table_.begin();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000793 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000794 const_iterator end() const _NOEXCEPT {return __table_.end();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000795 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000796 const_iterator cbegin() const _NOEXCEPT {return __table_.begin();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000797 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000798 const_iterator cend() const _NOEXCEPT {return __table_.end();}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000799
Howard Hinnant73d21a42010-09-04 23:28:19 +0000800#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000801 template <class... _Args>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000802 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000803 iterator emplace(_Args&&... __args)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000804 {return __table_.__emplace_multi(_VSTD::forward<_Args>(__args)...);}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000805 template <class... _Args>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000806 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000807 iterator emplace_hint(const_iterator __p, _Args&&... __args)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000808 {return __table_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
Howard Hinnant73d21a42010-09-04 23:28:19 +0000809#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000810 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000811 iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
Howard Hinnant73d21a42010-09-04 23:28:19 +0000812#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000813 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant0949eed2011-06-30 21:18:19 +0000814 iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000815#endif
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000816 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000817 iterator insert(const_iterator __p, const value_type& __x)
818 {return __table_.__insert_multi(__p, __x);}
Howard Hinnant73d21a42010-09-04 23:28:19 +0000819#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000820 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000821 iterator insert(const_iterator __p, value_type&& __x)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000822 {return __table_.__insert_multi(__p, _VSTD::move(__x));}
Howard Hinnant73d21a42010-09-04 23:28:19 +0000823#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000824 template <class _InputIterator>
825 void insert(_InputIterator __first, _InputIterator __last);
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000826 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000827 void insert(initializer_list<value_type> __il)
828 {insert(__il.begin(), __il.end());}
829
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000830 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000831 iterator erase(const_iterator __p) {return __table_.erase(__p);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000832 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000833 size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000834 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000835 iterator erase(const_iterator __first, const_iterator __last)
836 {return __table_.erase(__first, __last);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000837 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000838 void clear() _NOEXCEPT {__table_.clear();}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000839
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000840 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000841 void swap(unordered_multiset& __u)
842 _NOEXCEPT_(__is_nothrow_swappable<__table>::value)
843 {__table_.swap(__u.__table_);}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000844
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000845 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000846 hasher hash_function() const {return __table_.hash_function();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000847 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000848 key_equal key_eq() const {return __table_.key_eq();}
849
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000850 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000851 iterator find(const key_type& __k) {return __table_.find(__k);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000852 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000853 const_iterator find(const key_type& __k) const {return __table_.find(__k);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000854 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000855 size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000856 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000857 pair<iterator, iterator> equal_range(const key_type& __k)
858 {return __table_.__equal_range_multi(__k);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000859 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000860 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
861 {return __table_.__equal_range_multi(__k);}
862
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000863 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000864 size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000865 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000866 size_type max_bucket_count() const _NOEXCEPT {return __table_.max_bucket_count();}
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000867
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000868 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000869 size_type bucket_size(size_type __n) const {return __table_.bucket_size(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000870 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000871 size_type bucket(const key_type& __k) const {return __table_.bucket(__k);}
872
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000873 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000874 local_iterator begin(size_type __n) {return __table_.begin(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000875 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000876 local_iterator end(size_type __n) {return __table_.end(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000877 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000878 const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000879 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000880 const_local_iterator end(size_type __n) const {return __table_.cend(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000881 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000882 const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000883 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000884 const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
885
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000886 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000887 float load_factor() const _NOEXCEPT {return __table_.load_factor();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000888 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000889 float max_load_factor() const _NOEXCEPT {return __table_.max_load_factor();}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000890 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000891 void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000892 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000893 void rehash(size_type __n) {__table_.rehash(__n);}
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000894 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000895 void reserve(size_type __n) {__table_.reserve(__n);}
896};
897
898template <class _Value, class _Hash, class _Pred, class _Alloc>
899unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
900 size_type __n, const hasher& __hf, const key_equal& __eql)
901 : __table_(__hf, __eql)
902{
903 __table_.rehash(__n);
904}
905
906template <class _Value, class _Hash, class _Pred, class _Alloc>
907unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
908 size_type __n, const hasher& __hf, const key_equal& __eql,
909 const allocator_type& __a)
910 : __table_(__hf, __eql, __a)
911{
912 __table_.rehash(__n);
913}
914
915template <class _Value, class _Hash, class _Pred, class _Alloc>
916template <class _InputIterator>
917unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
918 _InputIterator __first, _InputIterator __last)
919{
920 insert(__first, __last);
921}
922
923template <class _Value, class _Hash, class _Pred, class _Alloc>
924template <class _InputIterator>
925unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
926 _InputIterator __first, _InputIterator __last, size_type __n,
927 const hasher& __hf, const key_equal& __eql)
928 : __table_(__hf, __eql)
929{
930 __table_.rehash(__n);
931 insert(__first, __last);
932}
933
934template <class _Value, class _Hash, class _Pred, class _Alloc>
935template <class _InputIterator>
936unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
937 _InputIterator __first, _InputIterator __last, size_type __n,
938 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
939 : __table_(__hf, __eql, __a)
940{
941 __table_.rehash(__n);
942 insert(__first, __last);
943}
944
945template <class _Value, class _Hash, class _Pred, class _Alloc>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000946inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000947unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
948 const allocator_type& __a)
949 : __table_(__a)
950{
951}
952
953template <class _Value, class _Hash, class _Pred, class _Alloc>
954unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
955 const unordered_multiset& __u)
956 : __table_(__u.__table_)
957{
958 __table_.rehash(__u.bucket_count());
959 insert(__u.begin(), __u.end());
960}
961
962template <class _Value, class _Hash, class _Pred, class _Alloc>
963unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
964 const unordered_multiset& __u, const allocator_type& __a)
965 : __table_(__u.__table_, __a)
966{
967 __table_.rehash(__u.bucket_count());
968 insert(__u.begin(), __u.end());
969}
970
Howard Hinnant73d21a42010-09-04 23:28:19 +0000971#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000972
973template <class _Value, class _Hash, class _Pred, class _Alloc>
Howard Hinnantee6ccd02010-09-23 18:58:28 +0000974inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000975unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
976 unordered_multiset&& __u)
Howard Hinnant04dae1d2011-06-04 20:18:37 +0000977 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000978 : __table_(_VSTD::move(__u.__table_))
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000979{
980}
981
982template <class _Value, class _Hash, class _Pred, class _Alloc>
983unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
984 unordered_multiset&& __u, const allocator_type& __a)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000985 : __table_(_VSTD::move(__u.__table_), __a)
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000986{
987 if (__a != __u.get_allocator())
988 {
989 iterator __i = __u.begin();
990 while (__u.size() != 0)
Howard Hinnant0949eed2011-06-30 21:18:19 +0000991 __table_.__insert_multi(_VSTD::move(__u.__table_.remove(__i++)->__value_));
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000992 }
993}
994
Howard Hinnant73d21a42010-09-04 23:28:19 +0000995#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000996
997template <class _Value, class _Hash, class _Pred, class _Alloc>
998unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
999 initializer_list<value_type> __il)
1000{
1001 insert(__il.begin(), __il.end());
1002}
1003
1004template <class _Value, class _Hash, class _Pred, class _Alloc>
1005unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1006 initializer_list<value_type> __il, size_type __n, const hasher& __hf,
1007 const key_equal& __eql)
1008 : __table_(__hf, __eql)
1009{
1010 __table_.rehash(__n);
1011 insert(__il.begin(), __il.end());
1012}
1013
1014template <class _Value, class _Hash, class _Pred, class _Alloc>
1015unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1016 initializer_list<value_type> __il, size_type __n, const hasher& __hf,
1017 const key_equal& __eql, const allocator_type& __a)
1018 : __table_(__hf, __eql, __a)
1019{
1020 __table_.rehash(__n);
1021 insert(__il.begin(), __il.end());
1022}
1023
Howard Hinnant73d21a42010-09-04 23:28:19 +00001024#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001025
1026template <class _Value, class _Hash, class _Pred, class _Alloc>
Howard Hinnantee6ccd02010-09-23 18:58:28 +00001027inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001028unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
1029unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
1030 unordered_multiset&& __u)
Howard Hinnant04dae1d2011-06-04 20:18:37 +00001031 _NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001032{
Howard Hinnant0949eed2011-06-30 21:18:19 +00001033 __table_ = _VSTD::move(__u.__table_);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001034 return *this;
1035}
1036
Howard Hinnant73d21a42010-09-04 23:28:19 +00001037#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001038
1039template <class _Value, class _Hash, class _Pred, class _Alloc>
1040inline
1041unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
1042unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
1043 initializer_list<value_type> __il)
1044{
1045 __table_.__assign_multi(__il.begin(), __il.end());
1046 return *this;
1047}
1048
1049template <class _Value, class _Hash, class _Pred, class _Alloc>
1050template <class _InputIterator>
Howard Hinnantee6ccd02010-09-23 18:58:28 +00001051inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001052void
1053unordered_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
1054 _InputIterator __last)
1055{
1056 for (; __first != __last; ++__first)
1057 __table_.__insert_multi(*__first);
1058}
1059
1060template <class _Value, class _Hash, class _Pred, class _Alloc>
Howard Hinnantee6ccd02010-09-23 18:58:28 +00001061inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001062void
1063swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1064 unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
Howard Hinnant04dae1d2011-06-04 20:18:37 +00001065 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001066{
1067 __x.swap(__y);
1068}
1069
1070template <class _Value, class _Hash, class _Pred, class _Alloc>
1071bool
1072operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1073 const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1074{
1075 if (__x.size() != __y.size())
1076 return false;
1077 typedef typename unordered_multiset<_Value, _Hash, _Pred, _Alloc>::const_iterator
1078 const_iterator;
1079 typedef pair<const_iterator, const_iterator> _EqRng;
1080 for (const_iterator __i = __x.begin(), __ex = __x.end(); __i != __ex;)
1081 {
1082 _EqRng __xeq = __x.equal_range(*__i);
1083 _EqRng __yeq = __y.equal_range(*__i);
Howard Hinnant0949eed2011-06-30 21:18:19 +00001084 if (_VSTD::distance(__xeq.first, __xeq.second) !=
1085 _VSTD::distance(__yeq.first, __yeq.second) ||
1086 !_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001087 return false;
1088 __i = __xeq.second;
1089 }
1090 return true;
1091}
1092
1093template <class _Value, class _Hash, class _Pred, class _Alloc>
Howard Hinnantee6ccd02010-09-23 18:58:28 +00001094inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001095bool
1096operator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1097 const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1098{
1099 return !(__x == __y);
1100}
1101
1102_LIBCPP_END_NAMESPACE_STD
1103
1104#endif // _LIBCPP_UNORDERED_SET