1*58b9f456SAndroid Build Coastguard Worker// -*- C++ -*- 2*58b9f456SAndroid Build Coastguard Worker//===-------------------------- unordered_set -----------------------------===// 3*58b9f456SAndroid Build Coastguard Worker// 4*58b9f456SAndroid Build Coastguard Worker// The LLVM Compiler Infrastructure 5*58b9f456SAndroid Build Coastguard Worker// 6*58b9f456SAndroid Build Coastguard Worker// This file is dual licensed under the MIT and the University of Illinois Open 7*58b9f456SAndroid Build Coastguard Worker// Source Licenses. See LICENSE.TXT for details. 8*58b9f456SAndroid Build Coastguard Worker// 9*58b9f456SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===// 10*58b9f456SAndroid Build Coastguard Worker 11*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_UNORDERED_SET 12*58b9f456SAndroid Build Coastguard Worker#define _LIBCPP_UNORDERED_SET 13*58b9f456SAndroid Build Coastguard Worker 14*58b9f456SAndroid Build Coastguard Worker/* 15*58b9f456SAndroid Build Coastguard Worker 16*58b9f456SAndroid Build Coastguard Worker unordered_set synopsis 17*58b9f456SAndroid Build Coastguard Worker 18*58b9f456SAndroid Build Coastguard Worker#include <initializer_list> 19*58b9f456SAndroid Build Coastguard Worker 20*58b9f456SAndroid Build Coastguard Workernamespace std 21*58b9f456SAndroid Build Coastguard Worker{ 22*58b9f456SAndroid Build Coastguard Worker 23*58b9f456SAndroid Build Coastguard Workertemplate <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, 24*58b9f456SAndroid Build Coastguard Worker class Alloc = allocator<Value>> 25*58b9f456SAndroid Build Coastguard Workerclass unordered_set 26*58b9f456SAndroid Build Coastguard Worker{ 27*58b9f456SAndroid Build Coastguard Workerpublic: 28*58b9f456SAndroid Build Coastguard Worker // types 29*58b9f456SAndroid Build Coastguard Worker typedef Value key_type; 30*58b9f456SAndroid Build Coastguard Worker typedef key_type value_type; 31*58b9f456SAndroid Build Coastguard Worker typedef Hash hasher; 32*58b9f456SAndroid Build Coastguard Worker typedef Pred key_equal; 33*58b9f456SAndroid Build Coastguard Worker typedef Alloc allocator_type; 34*58b9f456SAndroid Build Coastguard Worker typedef value_type& reference; 35*58b9f456SAndroid Build Coastguard Worker typedef const value_type& const_reference; 36*58b9f456SAndroid Build Coastguard Worker typedef typename allocator_traits<allocator_type>::pointer pointer; 37*58b9f456SAndroid Build Coastguard Worker typedef typename allocator_traits<allocator_type>::const_pointer const_pointer; 38*58b9f456SAndroid Build Coastguard Worker typedef typename allocator_traits<allocator_type>::size_type size_type; 39*58b9f456SAndroid Build Coastguard Worker typedef typename allocator_traits<allocator_type>::difference_type difference_type; 40*58b9f456SAndroid Build Coastguard Worker 41*58b9f456SAndroid Build Coastguard Worker typedef /unspecified/ iterator; 42*58b9f456SAndroid Build Coastguard Worker typedef /unspecified/ const_iterator; 43*58b9f456SAndroid Build Coastguard Worker typedef /unspecified/ local_iterator; 44*58b9f456SAndroid Build Coastguard Worker typedef /unspecified/ const_local_iterator; 45*58b9f456SAndroid Build Coastguard Worker 46*58b9f456SAndroid Build Coastguard Worker typedef unspecified node_type unspecified; // C++17 47*58b9f456SAndroid Build Coastguard Worker typedef INSERT_RETURN_TYPE<iterator, node_type> insert_return_type; // C++17 48*58b9f456SAndroid Build Coastguard Worker 49*58b9f456SAndroid Build Coastguard Worker unordered_set() 50*58b9f456SAndroid Build Coastguard Worker noexcept( 51*58b9f456SAndroid Build Coastguard Worker is_nothrow_default_constructible<hasher>::value && 52*58b9f456SAndroid Build Coastguard Worker is_nothrow_default_constructible<key_equal>::value && 53*58b9f456SAndroid Build Coastguard Worker is_nothrow_default_constructible<allocator_type>::value); 54*58b9f456SAndroid Build Coastguard Worker explicit unordered_set(size_type n, const hasher& hf = hasher(), 55*58b9f456SAndroid Build Coastguard Worker const key_equal& eql = key_equal(), 56*58b9f456SAndroid Build Coastguard Worker const allocator_type& a = allocator_type()); 57*58b9f456SAndroid Build Coastguard Worker template <class InputIterator> 58*58b9f456SAndroid Build Coastguard Worker unordered_set(InputIterator f, InputIterator l, 59*58b9f456SAndroid Build Coastguard Worker size_type n = 0, const hasher& hf = hasher(), 60*58b9f456SAndroid Build Coastguard Worker const key_equal& eql = key_equal(), 61*58b9f456SAndroid Build Coastguard Worker const allocator_type& a = allocator_type()); 62*58b9f456SAndroid Build Coastguard Worker explicit unordered_set(const allocator_type&); 63*58b9f456SAndroid Build Coastguard Worker unordered_set(const unordered_set&); 64*58b9f456SAndroid Build Coastguard Worker unordered_set(const unordered_set&, const Allocator&); 65*58b9f456SAndroid Build Coastguard Worker unordered_set(unordered_set&&) 66*58b9f456SAndroid Build Coastguard Worker noexcept( 67*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_constructible<hasher>::value && 68*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_constructible<key_equal>::value && 69*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_constructible<allocator_type>::value); 70*58b9f456SAndroid Build Coastguard Worker unordered_set(unordered_set&&, const Allocator&); 71*58b9f456SAndroid Build Coastguard Worker unordered_set(initializer_list<value_type>, size_type n = 0, 72*58b9f456SAndroid Build Coastguard Worker const hasher& hf = hasher(), const key_equal& eql = key_equal(), 73*58b9f456SAndroid Build Coastguard Worker const allocator_type& a = allocator_type()); 74*58b9f456SAndroid Build Coastguard Worker unordered_set(size_type n, const allocator_type& a); // C++14 75*58b9f456SAndroid Build Coastguard Worker unordered_set(size_type n, const hasher& hf, const allocator_type& a); // C++14 76*58b9f456SAndroid Build Coastguard Worker template <class InputIterator> 77*58b9f456SAndroid Build Coastguard Worker unordered_set(InputIterator f, InputIterator l, size_type n, const allocator_type& a); // C++14 78*58b9f456SAndroid Build Coastguard Worker template <class InputIterator> 79*58b9f456SAndroid Build Coastguard Worker unordered_set(InputIterator f, InputIterator l, size_type n, 80*58b9f456SAndroid Build Coastguard Worker const hasher& hf, const allocator_type& a); // C++14 81*58b9f456SAndroid Build Coastguard Worker unordered_set(initializer_list<value_type> il, size_type n, const allocator_type& a); // C++14 82*58b9f456SAndroid Build Coastguard Worker unordered_set(initializer_list<value_type> il, size_type n, 83*58b9f456SAndroid Build Coastguard Worker const hasher& hf, const allocator_type& a); // C++14 84*58b9f456SAndroid Build Coastguard Worker ~unordered_set(); 85*58b9f456SAndroid Build Coastguard Worker unordered_set& operator=(const unordered_set&); 86*58b9f456SAndroid Build Coastguard Worker unordered_set& operator=(unordered_set&&) 87*58b9f456SAndroid Build Coastguard Worker noexcept( 88*58b9f456SAndroid Build Coastguard Worker allocator_type::propagate_on_container_move_assignment::value && 89*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_assignable<allocator_type>::value && 90*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_assignable<hasher>::value && 91*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_assignable<key_equal>::value); 92*58b9f456SAndroid Build Coastguard Worker unordered_set& operator=(initializer_list<value_type>); 93*58b9f456SAndroid Build Coastguard Worker 94*58b9f456SAndroid Build Coastguard Worker allocator_type get_allocator() const noexcept; 95*58b9f456SAndroid Build Coastguard Worker 96*58b9f456SAndroid Build Coastguard Worker bool empty() const noexcept; 97*58b9f456SAndroid Build Coastguard Worker size_type size() const noexcept; 98*58b9f456SAndroid Build Coastguard Worker size_type max_size() const noexcept; 99*58b9f456SAndroid Build Coastguard Worker 100*58b9f456SAndroid Build Coastguard Worker iterator begin() noexcept; 101*58b9f456SAndroid Build Coastguard Worker iterator end() noexcept; 102*58b9f456SAndroid Build Coastguard Worker const_iterator begin() const noexcept; 103*58b9f456SAndroid Build Coastguard Worker const_iterator end() const noexcept; 104*58b9f456SAndroid Build Coastguard Worker const_iterator cbegin() const noexcept; 105*58b9f456SAndroid Build Coastguard Worker const_iterator cend() const noexcept; 106*58b9f456SAndroid Build Coastguard Worker 107*58b9f456SAndroid Build Coastguard Worker template <class... Args> 108*58b9f456SAndroid Build Coastguard Worker pair<iterator, bool> emplace(Args&&... args); 109*58b9f456SAndroid Build Coastguard Worker template <class... Args> 110*58b9f456SAndroid Build Coastguard Worker iterator emplace_hint(const_iterator position, Args&&... args); 111*58b9f456SAndroid Build Coastguard Worker pair<iterator, bool> insert(const value_type& obj); 112*58b9f456SAndroid Build Coastguard Worker pair<iterator, bool> insert(value_type&& obj); 113*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator hint, const value_type& obj); 114*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator hint, value_type&& obj); 115*58b9f456SAndroid Build Coastguard Worker template <class InputIterator> 116*58b9f456SAndroid Build Coastguard Worker void insert(InputIterator first, InputIterator last); 117*58b9f456SAndroid Build Coastguard Worker void insert(initializer_list<value_type>); 118*58b9f456SAndroid Build Coastguard Worker 119*58b9f456SAndroid Build Coastguard Worker node_type extract(const_iterator position); // C++17 120*58b9f456SAndroid Build Coastguard Worker node_type extract(const key_type& x); // C++17 121*58b9f456SAndroid Build Coastguard Worker insert_return_type insert(node_type&& nh); // C++17 122*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator hint, node_type&& nh); // C++17 123*58b9f456SAndroid Build Coastguard Worker 124*58b9f456SAndroid Build Coastguard Worker iterator erase(const_iterator position); 125*58b9f456SAndroid Build Coastguard Worker iterator erase(iterator position); // C++14 126*58b9f456SAndroid Build Coastguard Worker size_type erase(const key_type& k); 127*58b9f456SAndroid Build Coastguard Worker iterator erase(const_iterator first, const_iterator last); 128*58b9f456SAndroid Build Coastguard Worker void clear() noexcept; 129*58b9f456SAndroid Build Coastguard Worker 130*58b9f456SAndroid Build Coastguard Worker template<class H2, class P2> 131*58b9f456SAndroid Build Coastguard Worker void merge(unordered_set<Key, H2, P2, Allocator>& source); // C++17 132*58b9f456SAndroid Build Coastguard Worker template<class H2, class P2> 133*58b9f456SAndroid Build Coastguard Worker void merge(unordered_set<Key, H2, P2, Allocator>&& source); // C++17 134*58b9f456SAndroid Build Coastguard Worker template<class H2, class P2> 135*58b9f456SAndroid Build Coastguard Worker void merge(unordered_multiset<Key, H2, P2, Allocator>& source); // C++17 136*58b9f456SAndroid Build Coastguard Worker template<class H2, class P2> 137*58b9f456SAndroid Build Coastguard Worker void merge(unordered_multiset<Key, H2, P2, Allocator>&& source); // C++17 138*58b9f456SAndroid Build Coastguard Worker 139*58b9f456SAndroid Build Coastguard Worker void swap(unordered_set&) 140*58b9f456SAndroid Build Coastguard Worker noexcept(allocator_traits<Allocator>::is_always_equal::value && 141*58b9f456SAndroid Build Coastguard Worker noexcept(swap(declval<hasher&>(), declval<hasher&>())) && 142*58b9f456SAndroid Build Coastguard Worker noexcept(swap(declval<key_equal&>(), declval<key_equal&>()))); // C++17 143*58b9f456SAndroid Build Coastguard Worker 144*58b9f456SAndroid Build Coastguard Worker hasher hash_function() const; 145*58b9f456SAndroid Build Coastguard Worker key_equal key_eq() const; 146*58b9f456SAndroid Build Coastguard Worker 147*58b9f456SAndroid Build Coastguard Worker iterator find(const key_type& k); 148*58b9f456SAndroid Build Coastguard Worker const_iterator find(const key_type& k) const; 149*58b9f456SAndroid Build Coastguard Worker size_type count(const key_type& k) const; 150*58b9f456SAndroid Build Coastguard Worker pair<iterator, iterator> equal_range(const key_type& k); 151*58b9f456SAndroid Build Coastguard Worker pair<const_iterator, const_iterator> equal_range(const key_type& k) const; 152*58b9f456SAndroid Build Coastguard Worker 153*58b9f456SAndroid Build Coastguard Worker size_type bucket_count() const noexcept; 154*58b9f456SAndroid Build Coastguard Worker size_type max_bucket_count() const noexcept; 155*58b9f456SAndroid Build Coastguard Worker 156*58b9f456SAndroid Build Coastguard Worker size_type bucket_size(size_type n) const; 157*58b9f456SAndroid Build Coastguard Worker size_type bucket(const key_type& k) const; 158*58b9f456SAndroid Build Coastguard Worker 159*58b9f456SAndroid Build Coastguard Worker local_iterator begin(size_type n); 160*58b9f456SAndroid Build Coastguard Worker local_iterator end(size_type n); 161*58b9f456SAndroid Build Coastguard Worker const_local_iterator begin(size_type n) const; 162*58b9f456SAndroid Build Coastguard Worker const_local_iterator end(size_type n) const; 163*58b9f456SAndroid Build Coastguard Worker const_local_iterator cbegin(size_type n) const; 164*58b9f456SAndroid Build Coastguard Worker const_local_iterator cend(size_type n) const; 165*58b9f456SAndroid Build Coastguard Worker 166*58b9f456SAndroid Build Coastguard Worker float load_factor() const noexcept; 167*58b9f456SAndroid Build Coastguard Worker float max_load_factor() const noexcept; 168*58b9f456SAndroid Build Coastguard Worker void max_load_factor(float z); 169*58b9f456SAndroid Build Coastguard Worker void rehash(size_type n); 170*58b9f456SAndroid Build Coastguard Worker void reserve(size_type n); 171*58b9f456SAndroid Build Coastguard Worker}; 172*58b9f456SAndroid Build Coastguard Worker 173*58b9f456SAndroid Build Coastguard Workertemplate <class Value, class Hash, class Pred, class Alloc> 174*58b9f456SAndroid Build Coastguard Worker void swap(unordered_set<Value, Hash, Pred, Alloc>& x, 175*58b9f456SAndroid Build Coastguard Worker unordered_set<Value, Hash, Pred, Alloc>& y) 176*58b9f456SAndroid Build Coastguard Worker noexcept(noexcept(x.swap(y))); 177*58b9f456SAndroid Build Coastguard Worker 178*58b9f456SAndroid Build Coastguard Workertemplate <class Value, class Hash, class Pred, class Alloc> 179*58b9f456SAndroid Build Coastguard Worker bool 180*58b9f456SAndroid Build Coastguard Worker operator==(const unordered_set<Value, Hash, Pred, Alloc>& x, 181*58b9f456SAndroid Build Coastguard Worker const unordered_set<Value, Hash, Pred, Alloc>& y); 182*58b9f456SAndroid Build Coastguard Worker 183*58b9f456SAndroid Build Coastguard Workertemplate <class Value, class Hash, class Pred, class Alloc> 184*58b9f456SAndroid Build Coastguard Worker bool 185*58b9f456SAndroid Build Coastguard Worker operator!=(const unordered_set<Value, Hash, Pred, Alloc>& x, 186*58b9f456SAndroid Build Coastguard Worker const unordered_set<Value, Hash, Pred, Alloc>& y); 187*58b9f456SAndroid Build Coastguard Worker 188*58b9f456SAndroid Build Coastguard Workertemplate <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, 189*58b9f456SAndroid Build Coastguard Worker class Alloc = allocator<Value>> 190*58b9f456SAndroid Build Coastguard Workerclass unordered_multiset 191*58b9f456SAndroid Build Coastguard Worker{ 192*58b9f456SAndroid Build Coastguard Workerpublic: 193*58b9f456SAndroid Build Coastguard Worker // types 194*58b9f456SAndroid Build Coastguard Worker typedef Value key_type; 195*58b9f456SAndroid Build Coastguard Worker typedef key_type value_type; 196*58b9f456SAndroid Build Coastguard Worker typedef Hash hasher; 197*58b9f456SAndroid Build Coastguard Worker typedef Pred key_equal; 198*58b9f456SAndroid Build Coastguard Worker typedef Alloc allocator_type; 199*58b9f456SAndroid Build Coastguard Worker typedef value_type& reference; 200*58b9f456SAndroid Build Coastguard Worker typedef const value_type& const_reference; 201*58b9f456SAndroid Build Coastguard Worker typedef typename allocator_traits<allocator_type>::pointer pointer; 202*58b9f456SAndroid Build Coastguard Worker typedef typename allocator_traits<allocator_type>::const_pointer const_pointer; 203*58b9f456SAndroid Build Coastguard Worker typedef typename allocator_traits<allocator_type>::size_type size_type; 204*58b9f456SAndroid Build Coastguard Worker typedef typename allocator_traits<allocator_type>::difference_type difference_type; 205*58b9f456SAndroid Build Coastguard Worker 206*58b9f456SAndroid Build Coastguard Worker typedef /unspecified/ iterator; 207*58b9f456SAndroid Build Coastguard Worker typedef /unspecified/ const_iterator; 208*58b9f456SAndroid Build Coastguard Worker typedef /unspecified/ local_iterator; 209*58b9f456SAndroid Build Coastguard Worker typedef /unspecified/ const_local_iterator; 210*58b9f456SAndroid Build Coastguard Worker 211*58b9f456SAndroid Build Coastguard Worker typedef unspecified node_type unspecified; // C++17 212*58b9f456SAndroid Build Coastguard Worker 213*58b9f456SAndroid Build Coastguard Worker unordered_multiset() 214*58b9f456SAndroid Build Coastguard Worker noexcept( 215*58b9f456SAndroid Build Coastguard Worker is_nothrow_default_constructible<hasher>::value && 216*58b9f456SAndroid Build Coastguard Worker is_nothrow_default_constructible<key_equal>::value && 217*58b9f456SAndroid Build Coastguard Worker is_nothrow_default_constructible<allocator_type>::value); 218*58b9f456SAndroid Build Coastguard Worker explicit unordered_multiset(size_type n, const hasher& hf = hasher(), 219*58b9f456SAndroid Build Coastguard Worker const key_equal& eql = key_equal(), 220*58b9f456SAndroid Build Coastguard Worker const allocator_type& a = allocator_type()); 221*58b9f456SAndroid Build Coastguard Worker template <class InputIterator> 222*58b9f456SAndroid Build Coastguard Worker unordered_multiset(InputIterator f, InputIterator l, 223*58b9f456SAndroid Build Coastguard Worker size_type n = 0, const hasher& hf = hasher(), 224*58b9f456SAndroid Build Coastguard Worker const key_equal& eql = key_equal(), 225*58b9f456SAndroid Build Coastguard Worker const allocator_type& a = allocator_type()); 226*58b9f456SAndroid Build Coastguard Worker explicit unordered_multiset(const allocator_type&); 227*58b9f456SAndroid Build Coastguard Worker unordered_multiset(const unordered_multiset&); 228*58b9f456SAndroid Build Coastguard Worker unordered_multiset(const unordered_multiset&, const Allocator&); 229*58b9f456SAndroid Build Coastguard Worker unordered_multiset(unordered_multiset&&) 230*58b9f456SAndroid Build Coastguard Worker noexcept( 231*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_constructible<hasher>::value && 232*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_constructible<key_equal>::value && 233*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_constructible<allocator_type>::value); 234*58b9f456SAndroid Build Coastguard Worker unordered_multiset(unordered_multiset&&, const Allocator&); 235*58b9f456SAndroid Build Coastguard Worker unordered_multiset(initializer_list<value_type>, size_type n = /see below/, 236*58b9f456SAndroid Build Coastguard Worker const hasher& hf = hasher(), const key_equal& eql = key_equal(), 237*58b9f456SAndroid Build Coastguard Worker const allocator_type& a = allocator_type()); 238*58b9f456SAndroid Build Coastguard Worker unordered_multiset(size_type n, const allocator_type& a); // C++14 239*58b9f456SAndroid Build Coastguard Worker unordered_multiset(size_type n, const hasher& hf, const allocator_type& a); // C++14 240*58b9f456SAndroid Build Coastguard Worker template <class InputIterator> 241*58b9f456SAndroid Build Coastguard Worker unordered_multiset(InputIterator f, InputIterator l, size_type n, const allocator_type& a); // C++14 242*58b9f456SAndroid Build Coastguard Worker template <class InputIterator> 243*58b9f456SAndroid Build Coastguard Worker unordered_multiset(InputIterator f, InputIterator l, size_type n, 244*58b9f456SAndroid Build Coastguard Worker const hasher& hf, const allocator_type& a); // C++14 245*58b9f456SAndroid Build Coastguard Worker unordered_multiset(initializer_list<value_type> il, size_type n, const allocator_type& a); // C++14 246*58b9f456SAndroid Build Coastguard Worker unordered_multiset(initializer_list<value_type> il, size_type n, 247*58b9f456SAndroid Build Coastguard Worker const hasher& hf, const allocator_type& a); // C++14 248*58b9f456SAndroid Build Coastguard Worker ~unordered_multiset(); 249*58b9f456SAndroid Build Coastguard Worker unordered_multiset& operator=(const unordered_multiset&); 250*58b9f456SAndroid Build Coastguard Worker unordered_multiset& operator=(unordered_multiset&&) 251*58b9f456SAndroid Build Coastguard Worker noexcept( 252*58b9f456SAndroid Build Coastguard Worker allocator_type::propagate_on_container_move_assignment::value && 253*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_assignable<allocator_type>::value && 254*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_assignable<hasher>::value && 255*58b9f456SAndroid Build Coastguard Worker is_nothrow_move_assignable<key_equal>::value); 256*58b9f456SAndroid Build Coastguard Worker unordered_multiset& operator=(initializer_list<value_type>); 257*58b9f456SAndroid Build Coastguard Worker 258*58b9f456SAndroid Build Coastguard Worker allocator_type get_allocator() const noexcept; 259*58b9f456SAndroid Build Coastguard Worker 260*58b9f456SAndroid Build Coastguard Worker bool empty() const noexcept; 261*58b9f456SAndroid Build Coastguard Worker size_type size() const noexcept; 262*58b9f456SAndroid Build Coastguard Worker size_type max_size() const noexcept; 263*58b9f456SAndroid Build Coastguard Worker 264*58b9f456SAndroid Build Coastguard Worker iterator begin() noexcept; 265*58b9f456SAndroid Build Coastguard Worker iterator end() noexcept; 266*58b9f456SAndroid Build Coastguard Worker const_iterator begin() const noexcept; 267*58b9f456SAndroid Build Coastguard Worker const_iterator end() const noexcept; 268*58b9f456SAndroid Build Coastguard Worker const_iterator cbegin() const noexcept; 269*58b9f456SAndroid Build Coastguard Worker const_iterator cend() const noexcept; 270*58b9f456SAndroid Build Coastguard Worker 271*58b9f456SAndroid Build Coastguard Worker template <class... Args> 272*58b9f456SAndroid Build Coastguard Worker iterator emplace(Args&&... args); 273*58b9f456SAndroid Build Coastguard Worker template <class... Args> 274*58b9f456SAndroid Build Coastguard Worker iterator emplace_hint(const_iterator position, Args&&... args); 275*58b9f456SAndroid Build Coastguard Worker iterator insert(const value_type& obj); 276*58b9f456SAndroid Build Coastguard Worker iterator insert(value_type&& obj); 277*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator hint, const value_type& obj); 278*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator hint, value_type&& obj); 279*58b9f456SAndroid Build Coastguard Worker template <class InputIterator> 280*58b9f456SAndroid Build Coastguard Worker void insert(InputIterator first, InputIterator last); 281*58b9f456SAndroid Build Coastguard Worker void insert(initializer_list<value_type>); 282*58b9f456SAndroid Build Coastguard Worker 283*58b9f456SAndroid Build Coastguard Worker node_type extract(const_iterator position); // C++17 284*58b9f456SAndroid Build Coastguard Worker node_type extract(const key_type& x); // C++17 285*58b9f456SAndroid Build Coastguard Worker iterator insert(node_type&& nh); // C++17 286*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator hint, node_type&& nh); // C++17 287*58b9f456SAndroid Build Coastguard Worker 288*58b9f456SAndroid Build Coastguard Worker iterator erase(const_iterator position); 289*58b9f456SAndroid Build Coastguard Worker iterator erase(iterator position); // C++14 290*58b9f456SAndroid Build Coastguard Worker size_type erase(const key_type& k); 291*58b9f456SAndroid Build Coastguard Worker iterator erase(const_iterator first, const_iterator last); 292*58b9f456SAndroid Build Coastguard Worker void clear() noexcept; 293*58b9f456SAndroid Build Coastguard Worker 294*58b9f456SAndroid Build Coastguard Worker template<class H2, class P2> 295*58b9f456SAndroid Build Coastguard Worker void merge(unordered_multiset<Key, H2, P2, Allocator>& source); // C++17 296*58b9f456SAndroid Build Coastguard Worker template<class H2, class P2> 297*58b9f456SAndroid Build Coastguard Worker void merge(unordered_multiset<Key, H2, P2, Allocator>&& source); // C++17 298*58b9f456SAndroid Build Coastguard Worker template<class H2, class P2> 299*58b9f456SAndroid Build Coastguard Worker void merge(unordered_set<Key, H2, P2, Allocator>& source); // C++17 300*58b9f456SAndroid Build Coastguard Worker template<class H2, class P2> 301*58b9f456SAndroid Build Coastguard Worker void merge(unordered_set<Key, H2, P2, Allocator>&& source); // C++17 302*58b9f456SAndroid Build Coastguard Worker 303*58b9f456SAndroid Build Coastguard Worker void swap(unordered_multiset&) 304*58b9f456SAndroid Build Coastguard Worker noexcept(allocator_traits<Allocator>::is_always_equal::value && 305*58b9f456SAndroid Build Coastguard Worker noexcept(swap(declval<hasher&>(), declval<hasher&>())) && 306*58b9f456SAndroid Build Coastguard Worker noexcept(swap(declval<key_equal&>(), declval<key_equal&>()))); // C++17 307*58b9f456SAndroid Build Coastguard Worker 308*58b9f456SAndroid Build Coastguard Worker hasher hash_function() const; 309*58b9f456SAndroid Build Coastguard Worker key_equal key_eq() const; 310*58b9f456SAndroid Build Coastguard Worker 311*58b9f456SAndroid Build Coastguard Worker iterator find(const key_type& k); 312*58b9f456SAndroid Build Coastguard Worker const_iterator find(const key_type& k) const; 313*58b9f456SAndroid Build Coastguard Worker size_type count(const key_type& k) const; 314*58b9f456SAndroid Build Coastguard Worker pair<iterator, iterator> equal_range(const key_type& k); 315*58b9f456SAndroid Build Coastguard Worker pair<const_iterator, const_iterator> equal_range(const key_type& k) const; 316*58b9f456SAndroid Build Coastguard Worker 317*58b9f456SAndroid Build Coastguard Worker size_type bucket_count() const noexcept; 318*58b9f456SAndroid Build Coastguard Worker size_type max_bucket_count() const noexcept; 319*58b9f456SAndroid Build Coastguard Worker 320*58b9f456SAndroid Build Coastguard Worker size_type bucket_size(size_type n) const; 321*58b9f456SAndroid Build Coastguard Worker size_type bucket(const key_type& k) const; 322*58b9f456SAndroid Build Coastguard Worker 323*58b9f456SAndroid Build Coastguard Worker local_iterator begin(size_type n); 324*58b9f456SAndroid Build Coastguard Worker local_iterator end(size_type n); 325*58b9f456SAndroid Build Coastguard Worker const_local_iterator begin(size_type n) const; 326*58b9f456SAndroid Build Coastguard Worker const_local_iterator end(size_type n) const; 327*58b9f456SAndroid Build Coastguard Worker const_local_iterator cbegin(size_type n) const; 328*58b9f456SAndroid Build Coastguard Worker const_local_iterator cend(size_type n) const; 329*58b9f456SAndroid Build Coastguard Worker 330*58b9f456SAndroid Build Coastguard Worker float load_factor() const noexcept; 331*58b9f456SAndroid Build Coastguard Worker float max_load_factor() const noexcept; 332*58b9f456SAndroid Build Coastguard Worker void max_load_factor(float z); 333*58b9f456SAndroid Build Coastguard Worker void rehash(size_type n); 334*58b9f456SAndroid Build Coastguard Worker void reserve(size_type n); 335*58b9f456SAndroid Build Coastguard Worker}; 336*58b9f456SAndroid Build Coastguard Worker 337*58b9f456SAndroid Build Coastguard Workertemplate <class Value, class Hash, class Pred, class Alloc> 338*58b9f456SAndroid Build Coastguard Worker void swap(unordered_multiset<Value, Hash, Pred, Alloc>& x, 339*58b9f456SAndroid Build Coastguard Worker unordered_multiset<Value, Hash, Pred, Alloc>& y) 340*58b9f456SAndroid Build Coastguard Worker noexcept(noexcept(x.swap(y))); 341*58b9f456SAndroid Build Coastguard Worker 342*58b9f456SAndroid Build Coastguard Workertemplate <class K, class T, class H, class P, class A, class Predicate> 343*58b9f456SAndroid Build Coastguard Worker void erase_if(unordered_set<K, T, H, P, A>& c, Predicate pred); // C++20 344*58b9f456SAndroid Build Coastguard Worker 345*58b9f456SAndroid Build Coastguard Workertemplate <class K, class T, class H, class P, class A, class Predicate> 346*58b9f456SAndroid Build Coastguard Worker void erase_if(unordered_multiset<K, T, H, P, A>& c, Predicate pred); // C++20 347*58b9f456SAndroid Build Coastguard Worker 348*58b9f456SAndroid Build Coastguard Worker 349*58b9f456SAndroid Build Coastguard Workertemplate <class Value, class Hash, class Pred, class Alloc> 350*58b9f456SAndroid Build Coastguard Worker bool 351*58b9f456SAndroid Build Coastguard Worker operator==(const unordered_multiset<Value, Hash, Pred, Alloc>& x, 352*58b9f456SAndroid Build Coastguard Worker const unordered_multiset<Value, Hash, Pred, Alloc>& y); 353*58b9f456SAndroid Build Coastguard Worker 354*58b9f456SAndroid Build Coastguard Workertemplate <class Value, class Hash, class Pred, class Alloc> 355*58b9f456SAndroid Build Coastguard Worker bool 356*58b9f456SAndroid Build Coastguard Worker operator!=(const unordered_multiset<Value, Hash, Pred, Alloc>& x, 357*58b9f456SAndroid Build Coastguard Worker const unordered_multiset<Value, Hash, Pred, Alloc>& y); 358*58b9f456SAndroid Build Coastguard Worker} // std 359*58b9f456SAndroid Build Coastguard Worker 360*58b9f456SAndroid Build Coastguard Worker*/ 361*58b9f456SAndroid Build Coastguard Worker 362*58b9f456SAndroid Build Coastguard Worker#include <__config> 363*58b9f456SAndroid Build Coastguard Worker#include <__hash_table> 364*58b9f456SAndroid Build Coastguard Worker#include <__node_handle> 365*58b9f456SAndroid Build Coastguard Worker#include <functional> 366*58b9f456SAndroid Build Coastguard Worker#include <version> 367*58b9f456SAndroid Build Coastguard Worker 368*58b9f456SAndroid Build Coastguard Worker#include <__debug> 369*58b9f456SAndroid Build Coastguard Worker 370*58b9f456SAndroid Build Coastguard Worker#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 371*58b9f456SAndroid Build Coastguard Worker#pragma GCC system_header 372*58b9f456SAndroid Build Coastguard Worker#endif 373*58b9f456SAndroid Build Coastguard Worker 374*58b9f456SAndroid Build Coastguard Worker_LIBCPP_BEGIN_NAMESPACE_STD 375*58b9f456SAndroid Build Coastguard Worker 376*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 377*58b9f456SAndroid Build Coastguard Workerclass unordered_multiset; 378*58b9f456SAndroid Build Coastguard Worker 379*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>, 380*58b9f456SAndroid Build Coastguard Worker class _Alloc = allocator<_Value> > 381*58b9f456SAndroid Build Coastguard Workerclass _LIBCPP_TEMPLATE_VIS unordered_set 382*58b9f456SAndroid Build Coastguard Worker{ 383*58b9f456SAndroid Build Coastguard Workerpublic: 384*58b9f456SAndroid Build Coastguard Worker // types 385*58b9f456SAndroid Build Coastguard Worker typedef _Value key_type; 386*58b9f456SAndroid Build Coastguard Worker typedef key_type value_type; 387*58b9f456SAndroid Build Coastguard Worker typedef _Hash hasher; 388*58b9f456SAndroid Build Coastguard Worker typedef _Pred key_equal; 389*58b9f456SAndroid Build Coastguard Worker typedef _Alloc allocator_type; 390*58b9f456SAndroid Build Coastguard Worker typedef value_type& reference; 391*58b9f456SAndroid Build Coastguard Worker typedef const value_type& const_reference; 392*58b9f456SAndroid Build Coastguard Worker static_assert((is_same<value_type, typename allocator_type::value_type>::value), 393*58b9f456SAndroid Build Coastguard Worker "Invalid allocator::value_type"); 394*58b9f456SAndroid Build Coastguard Worker static_assert(sizeof(__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), ""); 395*58b9f456SAndroid Build Coastguard Worker 396*58b9f456SAndroid Build Coastguard Workerprivate: 397*58b9f456SAndroid Build Coastguard Worker typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table; 398*58b9f456SAndroid Build Coastguard Worker 399*58b9f456SAndroid Build Coastguard Worker __table __table_; 400*58b9f456SAndroid Build Coastguard Worker 401*58b9f456SAndroid Build Coastguard Workerpublic: 402*58b9f456SAndroid Build Coastguard Worker typedef typename __table::pointer pointer; 403*58b9f456SAndroid Build Coastguard Worker typedef typename __table::const_pointer const_pointer; 404*58b9f456SAndroid Build Coastguard Worker typedef typename __table::size_type size_type; 405*58b9f456SAndroid Build Coastguard Worker typedef typename __table::difference_type difference_type; 406*58b9f456SAndroid Build Coastguard Worker 407*58b9f456SAndroid Build Coastguard Worker typedef typename __table::const_iterator iterator; 408*58b9f456SAndroid Build Coastguard Worker typedef typename __table::const_iterator const_iterator; 409*58b9f456SAndroid Build Coastguard Worker typedef typename __table::const_local_iterator local_iterator; 410*58b9f456SAndroid Build Coastguard Worker typedef typename __table::const_local_iterator const_local_iterator; 411*58b9f456SAndroid Build Coastguard Worker 412*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 14 413*58b9f456SAndroid Build Coastguard Worker typedef __set_node_handle<typename __table::__node, allocator_type> node_type; 414*58b9f456SAndroid Build Coastguard Worker typedef __insert_return_type<iterator, node_type> insert_return_type; 415*58b9f456SAndroid Build Coastguard Worker#endif 416*58b9f456SAndroid Build Coastguard Worker 417*58b9f456SAndroid Build Coastguard Worker template <class _Value2, class _Hash2, class _Pred2, class _Alloc2> 418*58b9f456SAndroid Build Coastguard Worker friend class _LIBCPP_TEMPLATE_VIS unordered_set; 419*58b9f456SAndroid Build Coastguard Worker template <class _Value2, class _Hash2, class _Pred2, class _Alloc2> 420*58b9f456SAndroid Build Coastguard Worker friend class _LIBCPP_TEMPLATE_VIS unordered_multiset; 421*58b9f456SAndroid Build Coastguard Worker 422*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 423*58b9f456SAndroid Build Coastguard Worker unordered_set() 424*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(is_nothrow_default_constructible<__table>::value) 425*58b9f456SAndroid Build Coastguard Worker { 426*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 427*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 428*58b9f456SAndroid Build Coastguard Worker#endif 429*58b9f456SAndroid Build Coastguard Worker } 430*58b9f456SAndroid Build Coastguard Worker explicit unordered_set(size_type __n, const hasher& __hf = hasher(), 431*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql = key_equal()); 432*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 11 433*58b9f456SAndroid Build Coastguard Worker inline _LIBCPP_INLINE_VISIBILITY 434*58b9f456SAndroid Build Coastguard Worker unordered_set(size_type __n, const allocator_type& __a) 435*58b9f456SAndroid Build Coastguard Worker : unordered_set(__n, hasher(), key_equal(), __a) {} 436*58b9f456SAndroid Build Coastguard Worker inline _LIBCPP_INLINE_VISIBILITY 437*58b9f456SAndroid Build Coastguard Worker unordered_set(size_type __n, const hasher& __hf, const allocator_type& __a) 438*58b9f456SAndroid Build Coastguard Worker : unordered_set(__n, __hf, key_equal(), __a) {} 439*58b9f456SAndroid Build Coastguard Worker#endif 440*58b9f456SAndroid Build Coastguard Worker unordered_set(size_type __n, const hasher& __hf, const key_equal& __eql, 441*58b9f456SAndroid Build Coastguard Worker const allocator_type& __a); 442*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 443*58b9f456SAndroid Build Coastguard Worker unordered_set(_InputIterator __first, _InputIterator __last); 444*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 445*58b9f456SAndroid Build Coastguard Worker unordered_set(_InputIterator __first, _InputIterator __last, 446*58b9f456SAndroid Build Coastguard Worker size_type __n, const hasher& __hf = hasher(), 447*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql = key_equal()); 448*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 449*58b9f456SAndroid Build Coastguard Worker unordered_set(_InputIterator __first, _InputIterator __last, 450*58b9f456SAndroid Build Coastguard Worker size_type __n, const hasher& __hf, const key_equal& __eql, 451*58b9f456SAndroid Build Coastguard Worker const allocator_type& __a); 452*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 11 453*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 454*58b9f456SAndroid Build Coastguard Worker inline _LIBCPP_INLINE_VISIBILITY 455*58b9f456SAndroid Build Coastguard Worker unordered_set(_InputIterator __first, _InputIterator __last, 456*58b9f456SAndroid Build Coastguard Worker size_type __n, const allocator_type& __a) 457*58b9f456SAndroid Build Coastguard Worker : unordered_set(__first, __last, __n, hasher(), key_equal(), __a) {} 458*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 459*58b9f456SAndroid Build Coastguard Worker unordered_set(_InputIterator __first, _InputIterator __last, 460*58b9f456SAndroid Build Coastguard Worker size_type __n, const hasher& __hf, const allocator_type& __a) 461*58b9f456SAndroid Build Coastguard Worker : unordered_set(__first, __last, __n, __hf, key_equal(), __a) {} 462*58b9f456SAndroid Build Coastguard Worker#endif 463*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 464*58b9f456SAndroid Build Coastguard Worker explicit unordered_set(const allocator_type& __a); 465*58b9f456SAndroid Build Coastguard Worker unordered_set(const unordered_set& __u); 466*58b9f456SAndroid Build Coastguard Worker unordered_set(const unordered_set& __u, const allocator_type& __a); 467*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 468*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 469*58b9f456SAndroid Build Coastguard Worker unordered_set(unordered_set&& __u) 470*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(is_nothrow_move_constructible<__table>::value); 471*58b9f456SAndroid Build Coastguard Worker unordered_set(unordered_set&& __u, const allocator_type& __a); 472*58b9f456SAndroid Build Coastguard Worker unordered_set(initializer_list<value_type> __il); 473*58b9f456SAndroid Build Coastguard Worker unordered_set(initializer_list<value_type> __il, size_type __n, 474*58b9f456SAndroid Build Coastguard Worker const hasher& __hf = hasher(), 475*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql = key_equal()); 476*58b9f456SAndroid Build Coastguard Worker unordered_set(initializer_list<value_type> __il, size_type __n, 477*58b9f456SAndroid Build Coastguard Worker const hasher& __hf, const key_equal& __eql, 478*58b9f456SAndroid Build Coastguard Worker const allocator_type& __a); 479*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 11 480*58b9f456SAndroid Build Coastguard Worker inline _LIBCPP_INLINE_VISIBILITY 481*58b9f456SAndroid Build Coastguard Worker unordered_set(initializer_list<value_type> __il, size_type __n, 482*58b9f456SAndroid Build Coastguard Worker const allocator_type& __a) 483*58b9f456SAndroid Build Coastguard Worker : unordered_set(__il, __n, hasher(), key_equal(), __a) {} 484*58b9f456SAndroid Build Coastguard Worker inline _LIBCPP_INLINE_VISIBILITY 485*58b9f456SAndroid Build Coastguard Worker unordered_set(initializer_list<value_type> __il, size_type __n, 486*58b9f456SAndroid Build Coastguard Worker const hasher& __hf, const allocator_type& __a) 487*58b9f456SAndroid Build Coastguard Worker : unordered_set(__il, __n, __hf, key_equal(), __a) {} 488*58b9f456SAndroid Build Coastguard Worker#endif 489*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_CXX03_LANG 490*58b9f456SAndroid Build Coastguard Worker // ~unordered_set() = default; 491*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 492*58b9f456SAndroid Build Coastguard Worker unordered_set& operator=(const unordered_set& __u) 493*58b9f456SAndroid Build Coastguard Worker { 494*58b9f456SAndroid Build Coastguard Worker __table_ = __u.__table_; 495*58b9f456SAndroid Build Coastguard Worker return *this; 496*58b9f456SAndroid Build Coastguard Worker } 497*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 498*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 499*58b9f456SAndroid Build Coastguard Worker unordered_set& operator=(unordered_set&& __u) 500*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(is_nothrow_move_assignable<__table>::value); 501*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 502*58b9f456SAndroid Build Coastguard Worker unordered_set& operator=(initializer_list<value_type> __il); 503*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_CXX03_LANG 504*58b9f456SAndroid Build Coastguard Worker 505*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 506*58b9f456SAndroid Build Coastguard Worker allocator_type get_allocator() const _NOEXCEPT 507*58b9f456SAndroid Build Coastguard Worker {return allocator_type(__table_.__node_alloc());} 508*58b9f456SAndroid Build Coastguard Worker 509*58b9f456SAndroid Build Coastguard Worker _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY 510*58b9f456SAndroid Build Coastguard Worker bool empty() const _NOEXCEPT {return __table_.size() == 0;} 511*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 512*58b9f456SAndroid Build Coastguard Worker size_type size() const _NOEXCEPT {return __table_.size();} 513*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 514*58b9f456SAndroid Build Coastguard Worker size_type max_size() const _NOEXCEPT {return __table_.max_size();} 515*58b9f456SAndroid Build Coastguard Worker 516*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 517*58b9f456SAndroid Build Coastguard Worker iterator begin() _NOEXCEPT {return __table_.begin();} 518*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 519*58b9f456SAndroid Build Coastguard Worker iterator end() _NOEXCEPT {return __table_.end();} 520*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 521*58b9f456SAndroid Build Coastguard Worker const_iterator begin() const _NOEXCEPT {return __table_.begin();} 522*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 523*58b9f456SAndroid Build Coastguard Worker const_iterator end() const _NOEXCEPT {return __table_.end();} 524*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 525*58b9f456SAndroid Build Coastguard Worker const_iterator cbegin() const _NOEXCEPT {return __table_.begin();} 526*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 527*58b9f456SAndroid Build Coastguard Worker const_iterator cend() const _NOEXCEPT {return __table_.end();} 528*58b9f456SAndroid Build Coastguard Worker 529*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 530*58b9f456SAndroid Build Coastguard Worker template <class... _Args> 531*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 532*58b9f456SAndroid Build Coastguard Worker pair<iterator, bool> emplace(_Args&&... __args) 533*58b9f456SAndroid Build Coastguard Worker {return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...);} 534*58b9f456SAndroid Build Coastguard Worker template <class... _Args> 535*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 536*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 537*58b9f456SAndroid Build Coastguard Worker iterator emplace_hint(const_iterator __p, _Args&&... __args) 538*58b9f456SAndroid Build Coastguard Worker { 539*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, 540*58b9f456SAndroid Build Coastguard Worker "unordered_set::emplace_hint(const_iterator, args...) called with an iterator not" 541*58b9f456SAndroid Build Coastguard Worker " referring to this unordered_set"); 542*58b9f456SAndroid Build Coastguard Worker return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first; 543*58b9f456SAndroid Build Coastguard Worker } 544*58b9f456SAndroid Build Coastguard Worker#else 545*58b9f456SAndroid Build Coastguard Worker iterator emplace_hint(const_iterator, _Args&&... __args) 546*58b9f456SAndroid Build Coastguard Worker {return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;} 547*58b9f456SAndroid Build Coastguard Worker#endif 548*58b9f456SAndroid Build Coastguard Worker 549*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 550*58b9f456SAndroid Build Coastguard Worker pair<iterator, bool> insert(value_type&& __x) 551*58b9f456SAndroid Build Coastguard Worker {return __table_.__insert_unique(_VSTD::move(__x));} 552*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 553*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 554*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator __p, value_type&& __x) 555*58b9f456SAndroid Build Coastguard Worker { 556*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, 557*58b9f456SAndroid Build Coastguard Worker "unordered_set::insert(const_iterator, value_type&&) called with an iterator not" 558*58b9f456SAndroid Build Coastguard Worker " referring to this unordered_set"); 559*58b9f456SAndroid Build Coastguard Worker return insert(_VSTD::move(__x)).first; 560*58b9f456SAndroid Build Coastguard Worker } 561*58b9f456SAndroid Build Coastguard Worker#else 562*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator, value_type&& __x) 563*58b9f456SAndroid Build Coastguard Worker {return insert(_VSTD::move(__x)).first;} 564*58b9f456SAndroid Build Coastguard Worker#endif 565*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 566*58b9f456SAndroid Build Coastguard Worker void insert(initializer_list<value_type> __il) 567*58b9f456SAndroid Build Coastguard Worker {insert(__il.begin(), __il.end());} 568*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_CXX03_LANG 569*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 570*58b9f456SAndroid Build Coastguard Worker pair<iterator, bool> insert(const value_type& __x) 571*58b9f456SAndroid Build Coastguard Worker {return __table_.__insert_unique(__x);} 572*58b9f456SAndroid Build Coastguard Worker 573*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 574*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 575*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator __p, const value_type& __x) 576*58b9f456SAndroid Build Coastguard Worker { 577*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, 578*58b9f456SAndroid Build Coastguard Worker "unordered_set::insert(const_iterator, const value_type&) called with an iterator not" 579*58b9f456SAndroid Build Coastguard Worker " referring to this unordered_set"); 580*58b9f456SAndroid Build Coastguard Worker return insert(__x).first; 581*58b9f456SAndroid Build Coastguard Worker } 582*58b9f456SAndroid Build Coastguard Worker#else 583*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator, const value_type& __x) 584*58b9f456SAndroid Build Coastguard Worker {return insert(__x).first;} 585*58b9f456SAndroid Build Coastguard Worker#endif 586*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 587*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 588*58b9f456SAndroid Build Coastguard Worker void insert(_InputIterator __first, _InputIterator __last); 589*58b9f456SAndroid Build Coastguard Worker 590*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 591*58b9f456SAndroid Build Coastguard Worker iterator erase(const_iterator __p) {return __table_.erase(__p);} 592*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 593*58b9f456SAndroid Build Coastguard Worker size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);} 594*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 595*58b9f456SAndroid Build Coastguard Worker iterator erase(const_iterator __first, const_iterator __last) 596*58b9f456SAndroid Build Coastguard Worker {return __table_.erase(__first, __last);} 597*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 598*58b9f456SAndroid Build Coastguard Worker void clear() _NOEXCEPT {__table_.clear();} 599*58b9f456SAndroid Build Coastguard Worker 600*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 14 601*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 602*58b9f456SAndroid Build Coastguard Worker insert_return_type insert(node_type&& __nh) 603*58b9f456SAndroid Build Coastguard Worker { 604*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(), 605*58b9f456SAndroid Build Coastguard Worker "node_type with incompatible allocator passed to unordered_set::insert()"); 606*58b9f456SAndroid Build Coastguard Worker return __table_.template __node_handle_insert_unique< 607*58b9f456SAndroid Build Coastguard Worker node_type, insert_return_type>(_VSTD::move(__nh)); 608*58b9f456SAndroid Build Coastguard Worker } 609*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 610*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator __h, node_type&& __nh) 611*58b9f456SAndroid Build Coastguard Worker { 612*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(), 613*58b9f456SAndroid Build Coastguard Worker "node_type with incompatible allocator passed to unordered_set::insert()"); 614*58b9f456SAndroid Build Coastguard Worker return __table_.template __node_handle_insert_unique<node_type>( 615*58b9f456SAndroid Build Coastguard Worker __h, _VSTD::move(__nh)); 616*58b9f456SAndroid Build Coastguard Worker } 617*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 618*58b9f456SAndroid Build Coastguard Worker node_type extract(key_type const& __key) 619*58b9f456SAndroid Build Coastguard Worker { 620*58b9f456SAndroid Build Coastguard Worker return __table_.template __node_handle_extract<node_type>(__key); 621*58b9f456SAndroid Build Coastguard Worker } 622*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 623*58b9f456SAndroid Build Coastguard Worker node_type extract(const_iterator __it) 624*58b9f456SAndroid Build Coastguard Worker { 625*58b9f456SAndroid Build Coastguard Worker return __table_.template __node_handle_extract<node_type>(__it); 626*58b9f456SAndroid Build Coastguard Worker } 627*58b9f456SAndroid Build Coastguard Worker 628*58b9f456SAndroid Build Coastguard Worker template<class _H2, class _P2> 629*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 630*58b9f456SAndroid Build Coastguard Worker void merge(unordered_set<key_type, _H2, _P2, allocator_type>& __source) 631*58b9f456SAndroid Build Coastguard Worker { 632*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(), 633*58b9f456SAndroid Build Coastguard Worker "merging container with incompatible allocator"); 634*58b9f456SAndroid Build Coastguard Worker __table_.__node_handle_merge_unique(__source.__table_); 635*58b9f456SAndroid Build Coastguard Worker } 636*58b9f456SAndroid Build Coastguard Worker template<class _H2, class _P2> 637*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 638*58b9f456SAndroid Build Coastguard Worker void merge(unordered_set<key_type, _H2, _P2, allocator_type>&& __source) 639*58b9f456SAndroid Build Coastguard Worker { 640*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(), 641*58b9f456SAndroid Build Coastguard Worker "merging container with incompatible allocator"); 642*58b9f456SAndroid Build Coastguard Worker __table_.__node_handle_merge_unique(__source.__table_); 643*58b9f456SAndroid Build Coastguard Worker } 644*58b9f456SAndroid Build Coastguard Worker template<class _H2, class _P2> 645*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 646*58b9f456SAndroid Build Coastguard Worker void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>& __source) 647*58b9f456SAndroid Build Coastguard Worker { 648*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(), 649*58b9f456SAndroid Build Coastguard Worker "merging container with incompatible allocator"); 650*58b9f456SAndroid Build Coastguard Worker __table_.__node_handle_merge_unique(__source.__table_); 651*58b9f456SAndroid Build Coastguard Worker } 652*58b9f456SAndroid Build Coastguard Worker template<class _H2, class _P2> 653*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 654*58b9f456SAndroid Build Coastguard Worker void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>&& __source) 655*58b9f456SAndroid Build Coastguard Worker { 656*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(), 657*58b9f456SAndroid Build Coastguard Worker "merging container with incompatible allocator"); 658*58b9f456SAndroid Build Coastguard Worker __table_.__node_handle_merge_unique(__source.__table_); 659*58b9f456SAndroid Build Coastguard Worker } 660*58b9f456SAndroid Build Coastguard Worker#endif 661*58b9f456SAndroid Build Coastguard Worker 662*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 663*58b9f456SAndroid Build Coastguard Worker void swap(unordered_set& __u) 664*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(__is_nothrow_swappable<__table>::value) 665*58b9f456SAndroid Build Coastguard Worker {__table_.swap(__u.__table_);} 666*58b9f456SAndroid Build Coastguard Worker 667*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 668*58b9f456SAndroid Build Coastguard Worker hasher hash_function() const {return __table_.hash_function();} 669*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 670*58b9f456SAndroid Build Coastguard Worker key_equal key_eq() const {return __table_.key_eq();} 671*58b9f456SAndroid Build Coastguard Worker 672*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 673*58b9f456SAndroid Build Coastguard Worker iterator find(const key_type& __k) {return __table_.find(__k);} 674*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 675*58b9f456SAndroid Build Coastguard Worker const_iterator find(const key_type& __k) const {return __table_.find(__k);} 676*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 677*58b9f456SAndroid Build Coastguard Worker size_type count(const key_type& __k) const {return __table_.__count_unique(__k);} 678*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 679*58b9f456SAndroid Build Coastguard Worker pair<iterator, iterator> equal_range(const key_type& __k) 680*58b9f456SAndroid Build Coastguard Worker {return __table_.__equal_range_unique(__k);} 681*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 682*58b9f456SAndroid Build Coastguard Worker pair<const_iterator, const_iterator> equal_range(const key_type& __k) const 683*58b9f456SAndroid Build Coastguard Worker {return __table_.__equal_range_unique(__k);} 684*58b9f456SAndroid Build Coastguard Worker 685*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 686*58b9f456SAndroid Build Coastguard Worker size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();} 687*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 688*58b9f456SAndroid Build Coastguard Worker size_type max_bucket_count() const _NOEXCEPT {return __table_.max_bucket_count();} 689*58b9f456SAndroid Build Coastguard Worker 690*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 691*58b9f456SAndroid Build Coastguard Worker size_type bucket_size(size_type __n) const {return __table_.bucket_size(__n);} 692*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 693*58b9f456SAndroid Build Coastguard Worker size_type bucket(const key_type& __k) const {return __table_.bucket(__k);} 694*58b9f456SAndroid Build Coastguard Worker 695*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 696*58b9f456SAndroid Build Coastguard Worker local_iterator begin(size_type __n) {return __table_.begin(__n);} 697*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 698*58b9f456SAndroid Build Coastguard Worker local_iterator end(size_type __n) {return __table_.end(__n);} 699*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 700*58b9f456SAndroid Build Coastguard Worker const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);} 701*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 702*58b9f456SAndroid Build Coastguard Worker const_local_iterator end(size_type __n) const {return __table_.cend(__n);} 703*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 704*58b9f456SAndroid Build Coastguard Worker const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);} 705*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 706*58b9f456SAndroid Build Coastguard Worker const_local_iterator cend(size_type __n) const {return __table_.cend(__n);} 707*58b9f456SAndroid Build Coastguard Worker 708*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 709*58b9f456SAndroid Build Coastguard Worker float load_factor() const _NOEXCEPT {return __table_.load_factor();} 710*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 711*58b9f456SAndroid Build Coastguard Worker float max_load_factor() const _NOEXCEPT {return __table_.max_load_factor();} 712*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 713*58b9f456SAndroid Build Coastguard Worker void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);} 714*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 715*58b9f456SAndroid Build Coastguard Worker void rehash(size_type __n) {__table_.rehash(__n);} 716*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 717*58b9f456SAndroid Build Coastguard Worker void reserve(size_type __n) {__table_.reserve(__n);} 718*58b9f456SAndroid Build Coastguard Worker 719*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 720*58b9f456SAndroid Build Coastguard Worker 721*58b9f456SAndroid Build Coastguard Worker bool __dereferenceable(const const_iterator* __i) const 722*58b9f456SAndroid Build Coastguard Worker {return __table_.__dereferenceable(__i);} 723*58b9f456SAndroid Build Coastguard Worker bool __decrementable(const const_iterator* __i) const 724*58b9f456SAndroid Build Coastguard Worker {return __table_.__decrementable(__i);} 725*58b9f456SAndroid Build Coastguard Worker bool __addable(const const_iterator* __i, ptrdiff_t __n) const 726*58b9f456SAndroid Build Coastguard Worker {return __table_.__addable(__i, __n);} 727*58b9f456SAndroid Build Coastguard Worker bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const 728*58b9f456SAndroid Build Coastguard Worker {return __table_.__addable(__i, __n);} 729*58b9f456SAndroid Build Coastguard Worker 730*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_DEBUG_LEVEL >= 2 731*58b9f456SAndroid Build Coastguard Worker 732*58b9f456SAndroid Build Coastguard Worker}; 733*58b9f456SAndroid Build Coastguard Worker 734*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 735*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n, 736*58b9f456SAndroid Build Coastguard Worker const hasher& __hf, const key_equal& __eql) 737*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql) 738*58b9f456SAndroid Build Coastguard Worker{ 739*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 740*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 741*58b9f456SAndroid Build Coastguard Worker#endif 742*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 743*58b9f456SAndroid Build Coastguard Worker} 744*58b9f456SAndroid Build Coastguard Worker 745*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 746*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n, 747*58b9f456SAndroid Build Coastguard Worker const hasher& __hf, const key_equal& __eql, const allocator_type& __a) 748*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql, __a) 749*58b9f456SAndroid Build Coastguard Worker{ 750*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 751*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 752*58b9f456SAndroid Build Coastguard Worker#endif 753*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 754*58b9f456SAndroid Build Coastguard Worker} 755*58b9f456SAndroid Build Coastguard Worker 756*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 757*58b9f456SAndroid Build Coastguard Workertemplate <class _InputIterator> 758*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( 759*58b9f456SAndroid Build Coastguard Worker _InputIterator __first, _InputIterator __last) 760*58b9f456SAndroid Build Coastguard Worker{ 761*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 762*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 763*58b9f456SAndroid Build Coastguard Worker#endif 764*58b9f456SAndroid Build Coastguard Worker insert(__first, __last); 765*58b9f456SAndroid Build Coastguard Worker} 766*58b9f456SAndroid Build Coastguard Worker 767*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 768*58b9f456SAndroid Build Coastguard Workertemplate <class _InputIterator> 769*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( 770*58b9f456SAndroid Build Coastguard Worker _InputIterator __first, _InputIterator __last, size_type __n, 771*58b9f456SAndroid Build Coastguard Worker const hasher& __hf, const key_equal& __eql) 772*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql) 773*58b9f456SAndroid Build Coastguard Worker{ 774*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 775*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 776*58b9f456SAndroid Build Coastguard Worker#endif 777*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 778*58b9f456SAndroid Build Coastguard Worker insert(__first, __last); 779*58b9f456SAndroid Build Coastguard Worker} 780*58b9f456SAndroid Build Coastguard Worker 781*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 782*58b9f456SAndroid Build Coastguard Workertemplate <class _InputIterator> 783*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( 784*58b9f456SAndroid Build Coastguard Worker _InputIterator __first, _InputIterator __last, size_type __n, 785*58b9f456SAndroid Build Coastguard Worker const hasher& __hf, const key_equal& __eql, const allocator_type& __a) 786*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql, __a) 787*58b9f456SAndroid Build Coastguard Worker{ 788*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 789*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 790*58b9f456SAndroid Build Coastguard Worker#endif 791*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 792*58b9f456SAndroid Build Coastguard Worker insert(__first, __last); 793*58b9f456SAndroid Build Coastguard Worker} 794*58b9f456SAndroid Build Coastguard Worker 795*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 796*58b9f456SAndroid Build Coastguard Workerinline 797*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( 798*58b9f456SAndroid Build Coastguard Worker const allocator_type& __a) 799*58b9f456SAndroid Build Coastguard Worker : __table_(__a) 800*58b9f456SAndroid Build Coastguard Worker{ 801*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 802*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 803*58b9f456SAndroid Build Coastguard Worker#endif 804*58b9f456SAndroid Build Coastguard Worker} 805*58b9f456SAndroid Build Coastguard Worker 806*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 807*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( 808*58b9f456SAndroid Build Coastguard Worker const unordered_set& __u) 809*58b9f456SAndroid Build Coastguard Worker : __table_(__u.__table_) 810*58b9f456SAndroid Build Coastguard Worker{ 811*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 812*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 813*58b9f456SAndroid Build Coastguard Worker#endif 814*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__u.bucket_count()); 815*58b9f456SAndroid Build Coastguard Worker insert(__u.begin(), __u.end()); 816*58b9f456SAndroid Build Coastguard Worker} 817*58b9f456SAndroid Build Coastguard Worker 818*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 819*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( 820*58b9f456SAndroid Build Coastguard Worker const unordered_set& __u, const allocator_type& __a) 821*58b9f456SAndroid Build Coastguard Worker : __table_(__u.__table_, __a) 822*58b9f456SAndroid Build Coastguard Worker{ 823*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 824*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 825*58b9f456SAndroid Build Coastguard Worker#endif 826*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__u.bucket_count()); 827*58b9f456SAndroid Build Coastguard Worker insert(__u.begin(), __u.end()); 828*58b9f456SAndroid Build Coastguard Worker} 829*58b9f456SAndroid Build Coastguard Worker 830*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 831*58b9f456SAndroid Build Coastguard Worker 832*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 833*58b9f456SAndroid Build Coastguard Workerinline 834*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( 835*58b9f456SAndroid Build Coastguard Worker unordered_set&& __u) 836*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(is_nothrow_move_constructible<__table>::value) 837*58b9f456SAndroid Build Coastguard Worker : __table_(_VSTD::move(__u.__table_)) 838*58b9f456SAndroid Build Coastguard Worker{ 839*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 840*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 841*58b9f456SAndroid Build Coastguard Worker __get_db()->swap(this, &__u); 842*58b9f456SAndroid Build Coastguard Worker#endif 843*58b9f456SAndroid Build Coastguard Worker} 844*58b9f456SAndroid Build Coastguard Worker 845*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 846*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( 847*58b9f456SAndroid Build Coastguard Worker unordered_set&& __u, const allocator_type& __a) 848*58b9f456SAndroid Build Coastguard Worker : __table_(_VSTD::move(__u.__table_), __a) 849*58b9f456SAndroid Build Coastguard Worker{ 850*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 851*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 852*58b9f456SAndroid Build Coastguard Worker#endif 853*58b9f456SAndroid Build Coastguard Worker if (__a != __u.get_allocator()) 854*58b9f456SAndroid Build Coastguard Worker { 855*58b9f456SAndroid Build Coastguard Worker iterator __i = __u.begin(); 856*58b9f456SAndroid Build Coastguard Worker while (__u.size() != 0) 857*58b9f456SAndroid Build Coastguard Worker __table_.__insert_unique(_VSTD::move(__u.__table_.remove(__i++)->__value_)); 858*58b9f456SAndroid Build Coastguard Worker } 859*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 860*58b9f456SAndroid Build Coastguard Worker else 861*58b9f456SAndroid Build Coastguard Worker __get_db()->swap(this, &__u); 862*58b9f456SAndroid Build Coastguard Worker#endif 863*58b9f456SAndroid Build Coastguard Worker} 864*58b9f456SAndroid Build Coastguard Worker 865*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 866*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( 867*58b9f456SAndroid Build Coastguard Worker initializer_list<value_type> __il) 868*58b9f456SAndroid Build Coastguard Worker{ 869*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 870*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 871*58b9f456SAndroid Build Coastguard Worker#endif 872*58b9f456SAndroid Build Coastguard Worker insert(__il.begin(), __il.end()); 873*58b9f456SAndroid Build Coastguard Worker} 874*58b9f456SAndroid Build Coastguard Worker 875*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 876*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( 877*58b9f456SAndroid Build Coastguard Worker initializer_list<value_type> __il, size_type __n, const hasher& __hf, 878*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql) 879*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql) 880*58b9f456SAndroid Build Coastguard Worker{ 881*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 882*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 883*58b9f456SAndroid Build Coastguard Worker#endif 884*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 885*58b9f456SAndroid Build Coastguard Worker insert(__il.begin(), __il.end()); 886*58b9f456SAndroid Build Coastguard Worker} 887*58b9f456SAndroid Build Coastguard Worker 888*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 889*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( 890*58b9f456SAndroid Build Coastguard Worker initializer_list<value_type> __il, size_type __n, const hasher& __hf, 891*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql, const allocator_type& __a) 892*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql, __a) 893*58b9f456SAndroid Build Coastguard Worker{ 894*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 895*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 896*58b9f456SAndroid Build Coastguard Worker#endif 897*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 898*58b9f456SAndroid Build Coastguard Worker insert(__il.begin(), __il.end()); 899*58b9f456SAndroid Build Coastguard Worker} 900*58b9f456SAndroid Build Coastguard Worker 901*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 902*58b9f456SAndroid Build Coastguard Workerinline 903*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>& 904*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u) 905*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(is_nothrow_move_assignable<__table>::value) 906*58b9f456SAndroid Build Coastguard Worker{ 907*58b9f456SAndroid Build Coastguard Worker __table_ = _VSTD::move(__u.__table_); 908*58b9f456SAndroid Build Coastguard Worker return *this; 909*58b9f456SAndroid Build Coastguard Worker} 910*58b9f456SAndroid Build Coastguard Worker 911*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 912*58b9f456SAndroid Build Coastguard Workerinline 913*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>& 914*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::operator=( 915*58b9f456SAndroid Build Coastguard Worker initializer_list<value_type> __il) 916*58b9f456SAndroid Build Coastguard Worker{ 917*58b9f456SAndroid Build Coastguard Worker __table_.__assign_unique(__il.begin(), __il.end()); 918*58b9f456SAndroid Build Coastguard Worker return *this; 919*58b9f456SAndroid Build Coastguard Worker} 920*58b9f456SAndroid Build Coastguard Worker 921*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_CXX03_LANG 922*58b9f456SAndroid Build Coastguard Worker 923*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 924*58b9f456SAndroid Build Coastguard Workertemplate <class _InputIterator> 925*58b9f456SAndroid Build Coastguard Workerinline 926*58b9f456SAndroid Build Coastguard Workervoid 927*58b9f456SAndroid Build Coastguard Workerunordered_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, 928*58b9f456SAndroid Build Coastguard Worker _InputIterator __last) 929*58b9f456SAndroid Build Coastguard Worker{ 930*58b9f456SAndroid Build Coastguard Worker for (; __first != __last; ++__first) 931*58b9f456SAndroid Build Coastguard Worker __table_.__insert_unique(*__first); 932*58b9f456SAndroid Build Coastguard Worker} 933*58b9f456SAndroid Build Coastguard Worker 934*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 935*58b9f456SAndroid Build Coastguard Workerinline _LIBCPP_INLINE_VISIBILITY 936*58b9f456SAndroid Build Coastguard Workervoid 937*58b9f456SAndroid Build Coastguard Workerswap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, 938*58b9f456SAndroid Build Coastguard Worker unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) 939*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) 940*58b9f456SAndroid Build Coastguard Worker{ 941*58b9f456SAndroid Build Coastguard Worker __x.swap(__y); 942*58b9f456SAndroid Build Coastguard Worker} 943*58b9f456SAndroid Build Coastguard Worker 944*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 17 945*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc, class _Predicate> 946*58b9f456SAndroid Build Coastguard Workerinline _LIBCPP_INLINE_VISIBILITY 947*58b9f456SAndroid Build Coastguard Workervoid erase_if(unordered_set<_Value, _Hash, _Pred, _Alloc>& __c, _Predicate __pred) 948*58b9f456SAndroid Build Coastguard Worker{ __libcpp_erase_if_container(__c, __pred); } 949*58b9f456SAndroid Build Coastguard Worker#endif 950*58b9f456SAndroid Build Coastguard Worker 951*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 952*58b9f456SAndroid Build Coastguard Workerbool 953*58b9f456SAndroid Build Coastguard Workeroperator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, 954*58b9f456SAndroid Build Coastguard Worker const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) 955*58b9f456SAndroid Build Coastguard Worker{ 956*58b9f456SAndroid Build Coastguard Worker if (__x.size() != __y.size()) 957*58b9f456SAndroid Build Coastguard Worker return false; 958*58b9f456SAndroid Build Coastguard Worker typedef typename unordered_set<_Value, _Hash, _Pred, _Alloc>::const_iterator 959*58b9f456SAndroid Build Coastguard Worker const_iterator; 960*58b9f456SAndroid Build Coastguard Worker for (const_iterator __i = __x.begin(), __ex = __x.end(), __ey = __y.end(); 961*58b9f456SAndroid Build Coastguard Worker __i != __ex; ++__i) 962*58b9f456SAndroid Build Coastguard Worker { 963*58b9f456SAndroid Build Coastguard Worker const_iterator __j = __y.find(*__i); 964*58b9f456SAndroid Build Coastguard Worker if (__j == __ey || !(*__i == *__j)) 965*58b9f456SAndroid Build Coastguard Worker return false; 966*58b9f456SAndroid Build Coastguard Worker } 967*58b9f456SAndroid Build Coastguard Worker return true; 968*58b9f456SAndroid Build Coastguard Worker} 969*58b9f456SAndroid Build Coastguard Worker 970*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 971*58b9f456SAndroid Build Coastguard Workerinline _LIBCPP_INLINE_VISIBILITY 972*58b9f456SAndroid Build Coastguard Workerbool 973*58b9f456SAndroid Build Coastguard Workeroperator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, 974*58b9f456SAndroid Build Coastguard Worker const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) 975*58b9f456SAndroid Build Coastguard Worker{ 976*58b9f456SAndroid Build Coastguard Worker return !(__x == __y); 977*58b9f456SAndroid Build Coastguard Worker} 978*58b9f456SAndroid Build Coastguard Worker 979*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>, 980*58b9f456SAndroid Build Coastguard Worker class _Alloc = allocator<_Value> > 981*58b9f456SAndroid Build Coastguard Workerclass _LIBCPP_TEMPLATE_VIS unordered_multiset 982*58b9f456SAndroid Build Coastguard Worker{ 983*58b9f456SAndroid Build Coastguard Workerpublic: 984*58b9f456SAndroid Build Coastguard Worker // types 985*58b9f456SAndroid Build Coastguard Worker typedef _Value key_type; 986*58b9f456SAndroid Build Coastguard Worker typedef key_type value_type; 987*58b9f456SAndroid Build Coastguard Worker typedef _Hash hasher; 988*58b9f456SAndroid Build Coastguard Worker typedef _Pred key_equal; 989*58b9f456SAndroid Build Coastguard Worker typedef _Alloc allocator_type; 990*58b9f456SAndroid Build Coastguard Worker typedef value_type& reference; 991*58b9f456SAndroid Build Coastguard Worker typedef const value_type& const_reference; 992*58b9f456SAndroid Build Coastguard Worker static_assert((is_same<value_type, typename allocator_type::value_type>::value), 993*58b9f456SAndroid Build Coastguard Worker "Invalid allocator::value_type"); 994*58b9f456SAndroid Build Coastguard Worker static_assert(sizeof(__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), ""); 995*58b9f456SAndroid Build Coastguard Worker 996*58b9f456SAndroid Build Coastguard Workerprivate: 997*58b9f456SAndroid Build Coastguard Worker typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table; 998*58b9f456SAndroid Build Coastguard Worker 999*58b9f456SAndroid Build Coastguard Worker __table __table_; 1000*58b9f456SAndroid Build Coastguard Worker 1001*58b9f456SAndroid Build Coastguard Workerpublic: 1002*58b9f456SAndroid Build Coastguard Worker typedef typename __table::pointer pointer; 1003*58b9f456SAndroid Build Coastguard Worker typedef typename __table::const_pointer const_pointer; 1004*58b9f456SAndroid Build Coastguard Worker typedef typename __table::size_type size_type; 1005*58b9f456SAndroid Build Coastguard Worker typedef typename __table::difference_type difference_type; 1006*58b9f456SAndroid Build Coastguard Worker 1007*58b9f456SAndroid Build Coastguard Worker typedef typename __table::const_iterator iterator; 1008*58b9f456SAndroid Build Coastguard Worker typedef typename __table::const_iterator const_iterator; 1009*58b9f456SAndroid Build Coastguard Worker typedef typename __table::const_local_iterator local_iterator; 1010*58b9f456SAndroid Build Coastguard Worker typedef typename __table::const_local_iterator const_local_iterator; 1011*58b9f456SAndroid Build Coastguard Worker 1012*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 14 1013*58b9f456SAndroid Build Coastguard Worker typedef __set_node_handle<typename __table::__node, allocator_type> node_type; 1014*58b9f456SAndroid Build Coastguard Worker#endif 1015*58b9f456SAndroid Build Coastguard Worker 1016*58b9f456SAndroid Build Coastguard Worker template <class _Value2, class _Hash2, class _Pred2, class _Alloc2> 1017*58b9f456SAndroid Build Coastguard Worker friend class _LIBCPP_TEMPLATE_VIS unordered_set; 1018*58b9f456SAndroid Build Coastguard Worker template <class _Value2, class _Hash2, class _Pred2, class _Alloc2> 1019*58b9f456SAndroid Build Coastguard Worker friend class _LIBCPP_TEMPLATE_VIS unordered_multiset; 1020*58b9f456SAndroid Build Coastguard Worker 1021*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1022*58b9f456SAndroid Build Coastguard Worker unordered_multiset() 1023*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(is_nothrow_default_constructible<__table>::value) 1024*58b9f456SAndroid Build Coastguard Worker { 1025*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1026*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1027*58b9f456SAndroid Build Coastguard Worker#endif 1028*58b9f456SAndroid Build Coastguard Worker } 1029*58b9f456SAndroid Build Coastguard Worker explicit unordered_multiset(size_type __n, const hasher& __hf = hasher(), 1030*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql = key_equal()); 1031*58b9f456SAndroid Build Coastguard Worker unordered_multiset(size_type __n, const hasher& __hf, 1032*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql, const allocator_type& __a); 1033*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 11 1034*58b9f456SAndroid Build Coastguard Worker inline _LIBCPP_INLINE_VISIBILITY 1035*58b9f456SAndroid Build Coastguard Worker unordered_multiset(size_type __n, const allocator_type& __a) 1036*58b9f456SAndroid Build Coastguard Worker : unordered_multiset(__n, hasher(), key_equal(), __a) {} 1037*58b9f456SAndroid Build Coastguard Worker inline _LIBCPP_INLINE_VISIBILITY 1038*58b9f456SAndroid Build Coastguard Worker unordered_multiset(size_type __n, const hasher& __hf, const allocator_type& __a) 1039*58b9f456SAndroid Build Coastguard Worker : unordered_multiset(__n, __hf, key_equal(), __a) {} 1040*58b9f456SAndroid Build Coastguard Worker#endif 1041*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 1042*58b9f456SAndroid Build Coastguard Worker unordered_multiset(_InputIterator __first, _InputIterator __last); 1043*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 1044*58b9f456SAndroid Build Coastguard Worker unordered_multiset(_InputIterator __first, _InputIterator __last, 1045*58b9f456SAndroid Build Coastguard Worker size_type __n, const hasher& __hf = hasher(), 1046*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql = key_equal()); 1047*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 1048*58b9f456SAndroid Build Coastguard Worker unordered_multiset(_InputIterator __first, _InputIterator __last, 1049*58b9f456SAndroid Build Coastguard Worker size_type __n , const hasher& __hf, 1050*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql, const allocator_type& __a); 1051*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 11 1052*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 1053*58b9f456SAndroid Build Coastguard Worker inline _LIBCPP_INLINE_VISIBILITY 1054*58b9f456SAndroid Build Coastguard Worker unordered_multiset(_InputIterator __first, _InputIterator __last, 1055*58b9f456SAndroid Build Coastguard Worker size_type __n, const allocator_type& __a) 1056*58b9f456SAndroid Build Coastguard Worker : unordered_multiset(__first, __last, __n, hasher(), key_equal(), __a) {} 1057*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 1058*58b9f456SAndroid Build Coastguard Worker inline _LIBCPP_INLINE_VISIBILITY 1059*58b9f456SAndroid Build Coastguard Worker unordered_multiset(_InputIterator __first, _InputIterator __last, 1060*58b9f456SAndroid Build Coastguard Worker size_type __n, const hasher& __hf, const allocator_type& __a) 1061*58b9f456SAndroid Build Coastguard Worker : unordered_multiset(__first, __last, __n, __hf, key_equal(), __a) {} 1062*58b9f456SAndroid Build Coastguard Worker#endif 1063*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1064*58b9f456SAndroid Build Coastguard Worker explicit unordered_multiset(const allocator_type& __a); 1065*58b9f456SAndroid Build Coastguard Worker unordered_multiset(const unordered_multiset& __u); 1066*58b9f456SAndroid Build Coastguard Worker unordered_multiset(const unordered_multiset& __u, const allocator_type& __a); 1067*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 1068*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1069*58b9f456SAndroid Build Coastguard Worker unordered_multiset(unordered_multiset&& __u) 1070*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(is_nothrow_move_constructible<__table>::value); 1071*58b9f456SAndroid Build Coastguard Worker unordered_multiset(unordered_multiset&& __u, const allocator_type& __a); 1072*58b9f456SAndroid Build Coastguard Worker unordered_multiset(initializer_list<value_type> __il); 1073*58b9f456SAndroid Build Coastguard Worker unordered_multiset(initializer_list<value_type> __il, size_type __n, 1074*58b9f456SAndroid Build Coastguard Worker const hasher& __hf = hasher(), 1075*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql = key_equal()); 1076*58b9f456SAndroid Build Coastguard Worker unordered_multiset(initializer_list<value_type> __il, size_type __n, 1077*58b9f456SAndroid Build Coastguard Worker const hasher& __hf, const key_equal& __eql, 1078*58b9f456SAndroid Build Coastguard Worker const allocator_type& __a); 1079*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 11 1080*58b9f456SAndroid Build Coastguard Worker inline _LIBCPP_INLINE_VISIBILITY 1081*58b9f456SAndroid Build Coastguard Worker unordered_multiset(initializer_list<value_type> __il, size_type __n, const allocator_type& __a) 1082*58b9f456SAndroid Build Coastguard Worker : unordered_multiset(__il, __n, hasher(), key_equal(), __a) {} 1083*58b9f456SAndroid Build Coastguard Worker inline _LIBCPP_INLINE_VISIBILITY 1084*58b9f456SAndroid Build Coastguard Worker unordered_multiset(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a) 1085*58b9f456SAndroid Build Coastguard Worker : unordered_multiset(__il, __n, __hf, key_equal(), __a) {} 1086*58b9f456SAndroid Build Coastguard Worker#endif 1087*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_CXX03_LANG 1088*58b9f456SAndroid Build Coastguard Worker // ~unordered_multiset() = default; 1089*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1090*58b9f456SAndroid Build Coastguard Worker unordered_multiset& operator=(const unordered_multiset& __u) 1091*58b9f456SAndroid Build Coastguard Worker { 1092*58b9f456SAndroid Build Coastguard Worker __table_ = __u.__table_; 1093*58b9f456SAndroid Build Coastguard Worker return *this; 1094*58b9f456SAndroid Build Coastguard Worker } 1095*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 1096*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1097*58b9f456SAndroid Build Coastguard Worker unordered_multiset& operator=(unordered_multiset&& __u) 1098*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(is_nothrow_move_assignable<__table>::value); 1099*58b9f456SAndroid Build Coastguard Worker unordered_multiset& operator=(initializer_list<value_type> __il); 1100*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_CXX03_LANG 1101*58b9f456SAndroid Build Coastguard Worker 1102*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1103*58b9f456SAndroid Build Coastguard Worker allocator_type get_allocator() const _NOEXCEPT 1104*58b9f456SAndroid Build Coastguard Worker {return allocator_type(__table_.__node_alloc());} 1105*58b9f456SAndroid Build Coastguard Worker 1106*58b9f456SAndroid Build Coastguard Worker _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY 1107*58b9f456SAndroid Build Coastguard Worker bool empty() const _NOEXCEPT {return __table_.size() == 0;} 1108*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1109*58b9f456SAndroid Build Coastguard Worker size_type size() const _NOEXCEPT {return __table_.size();} 1110*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1111*58b9f456SAndroid Build Coastguard Worker size_type max_size() const _NOEXCEPT {return __table_.max_size();} 1112*58b9f456SAndroid Build Coastguard Worker 1113*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1114*58b9f456SAndroid Build Coastguard Worker iterator begin() _NOEXCEPT {return __table_.begin();} 1115*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1116*58b9f456SAndroid Build Coastguard Worker iterator end() _NOEXCEPT {return __table_.end();} 1117*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1118*58b9f456SAndroid Build Coastguard Worker const_iterator begin() const _NOEXCEPT {return __table_.begin();} 1119*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1120*58b9f456SAndroid Build Coastguard Worker const_iterator end() const _NOEXCEPT {return __table_.end();} 1121*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1122*58b9f456SAndroid Build Coastguard Worker const_iterator cbegin() const _NOEXCEPT {return __table_.begin();} 1123*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1124*58b9f456SAndroid Build Coastguard Worker const_iterator cend() const _NOEXCEPT {return __table_.end();} 1125*58b9f456SAndroid Build Coastguard Worker 1126*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 1127*58b9f456SAndroid Build Coastguard Worker template <class... _Args> 1128*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1129*58b9f456SAndroid Build Coastguard Worker iterator emplace(_Args&&... __args) 1130*58b9f456SAndroid Build Coastguard Worker {return __table_.__emplace_multi(_VSTD::forward<_Args>(__args)...);} 1131*58b9f456SAndroid Build Coastguard Worker template <class... _Args> 1132*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1133*58b9f456SAndroid Build Coastguard Worker iterator emplace_hint(const_iterator __p, _Args&&... __args) 1134*58b9f456SAndroid Build Coastguard Worker {return __table_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);} 1135*58b9f456SAndroid Build Coastguard Worker 1136*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1137*58b9f456SAndroid Build Coastguard Worker iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));} 1138*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1139*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator __p, value_type&& __x) 1140*58b9f456SAndroid Build Coastguard Worker {return __table_.__insert_multi(__p, _VSTD::move(__x));} 1141*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1142*58b9f456SAndroid Build Coastguard Worker void insert(initializer_list<value_type> __il) 1143*58b9f456SAndroid Build Coastguard Worker {insert(__il.begin(), __il.end());} 1144*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_CXX03_LANG 1145*58b9f456SAndroid Build Coastguard Worker 1146*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1147*58b9f456SAndroid Build Coastguard Worker iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);} 1148*58b9f456SAndroid Build Coastguard Worker 1149*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1150*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator __p, const value_type& __x) 1151*58b9f456SAndroid Build Coastguard Worker {return __table_.__insert_multi(__p, __x);} 1152*58b9f456SAndroid Build Coastguard Worker 1153*58b9f456SAndroid Build Coastguard Worker template <class _InputIterator> 1154*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1155*58b9f456SAndroid Build Coastguard Worker void insert(_InputIterator __first, _InputIterator __last); 1156*58b9f456SAndroid Build Coastguard Worker 1157*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 14 1158*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1159*58b9f456SAndroid Build Coastguard Worker iterator insert(node_type&& __nh) 1160*58b9f456SAndroid Build Coastguard Worker { 1161*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(), 1162*58b9f456SAndroid Build Coastguard Worker "node_type with incompatible allocator passed to unordered_multiset::insert()"); 1163*58b9f456SAndroid Build Coastguard Worker return __table_.template __node_handle_insert_multi<node_type>( 1164*58b9f456SAndroid Build Coastguard Worker _VSTD::move(__nh)); 1165*58b9f456SAndroid Build Coastguard Worker } 1166*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1167*58b9f456SAndroid Build Coastguard Worker iterator insert(const_iterator __hint, node_type&& __nh) 1168*58b9f456SAndroid Build Coastguard Worker { 1169*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(), 1170*58b9f456SAndroid Build Coastguard Worker "node_type with incompatible allocator passed to unordered_multiset::insert()"); 1171*58b9f456SAndroid Build Coastguard Worker return __table_.template __node_handle_insert_multi<node_type>( 1172*58b9f456SAndroid Build Coastguard Worker __hint, _VSTD::move(__nh)); 1173*58b9f456SAndroid Build Coastguard Worker } 1174*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1175*58b9f456SAndroid Build Coastguard Worker node_type extract(const_iterator __position) 1176*58b9f456SAndroid Build Coastguard Worker { 1177*58b9f456SAndroid Build Coastguard Worker return __table_.template __node_handle_extract<node_type>( 1178*58b9f456SAndroid Build Coastguard Worker __position); 1179*58b9f456SAndroid Build Coastguard Worker } 1180*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1181*58b9f456SAndroid Build Coastguard Worker node_type extract(key_type const& __key) 1182*58b9f456SAndroid Build Coastguard Worker { 1183*58b9f456SAndroid Build Coastguard Worker return __table_.template __node_handle_extract<node_type>(__key); 1184*58b9f456SAndroid Build Coastguard Worker } 1185*58b9f456SAndroid Build Coastguard Worker 1186*58b9f456SAndroid Build Coastguard Worker template <class _H2, class _P2> 1187*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1188*58b9f456SAndroid Build Coastguard Worker void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>& __source) 1189*58b9f456SAndroid Build Coastguard Worker { 1190*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(), 1191*58b9f456SAndroid Build Coastguard Worker "merging container with incompatible allocator"); 1192*58b9f456SAndroid Build Coastguard Worker return __table_.__node_handle_merge_multi(__source.__table_); 1193*58b9f456SAndroid Build Coastguard Worker } 1194*58b9f456SAndroid Build Coastguard Worker template <class _H2, class _P2> 1195*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1196*58b9f456SAndroid Build Coastguard Worker void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>&& __source) 1197*58b9f456SAndroid Build Coastguard Worker { 1198*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(), 1199*58b9f456SAndroid Build Coastguard Worker "merging container with incompatible allocator"); 1200*58b9f456SAndroid Build Coastguard Worker return __table_.__node_handle_merge_multi(__source.__table_); 1201*58b9f456SAndroid Build Coastguard Worker } 1202*58b9f456SAndroid Build Coastguard Worker template <class _H2, class _P2> 1203*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1204*58b9f456SAndroid Build Coastguard Worker void merge(unordered_set<key_type, _H2, _P2, allocator_type>& __source) 1205*58b9f456SAndroid Build Coastguard Worker { 1206*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(), 1207*58b9f456SAndroid Build Coastguard Worker "merging container with incompatible allocator"); 1208*58b9f456SAndroid Build Coastguard Worker return __table_.__node_handle_merge_multi(__source.__table_); 1209*58b9f456SAndroid Build Coastguard Worker } 1210*58b9f456SAndroid Build Coastguard Worker template <class _H2, class _P2> 1211*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1212*58b9f456SAndroid Build Coastguard Worker void merge(unordered_set<key_type, _H2, _P2, allocator_type>&& __source) 1213*58b9f456SAndroid Build Coastguard Worker { 1214*58b9f456SAndroid Build Coastguard Worker _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(), 1215*58b9f456SAndroid Build Coastguard Worker "merging container with incompatible allocator"); 1216*58b9f456SAndroid Build Coastguard Worker return __table_.__node_handle_merge_multi(__source.__table_); 1217*58b9f456SAndroid Build Coastguard Worker } 1218*58b9f456SAndroid Build Coastguard Worker#endif 1219*58b9f456SAndroid Build Coastguard Worker 1220*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1221*58b9f456SAndroid Build Coastguard Worker iterator erase(const_iterator __p) {return __table_.erase(__p);} 1222*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1223*58b9f456SAndroid Build Coastguard Worker size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);} 1224*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1225*58b9f456SAndroid Build Coastguard Worker iterator erase(const_iterator __first, const_iterator __last) 1226*58b9f456SAndroid Build Coastguard Worker {return __table_.erase(__first, __last);} 1227*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1228*58b9f456SAndroid Build Coastguard Worker void clear() _NOEXCEPT {__table_.clear();} 1229*58b9f456SAndroid Build Coastguard Worker 1230*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1231*58b9f456SAndroid Build Coastguard Worker void swap(unordered_multiset& __u) 1232*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(__is_nothrow_swappable<__table>::value) 1233*58b9f456SAndroid Build Coastguard Worker {__table_.swap(__u.__table_);} 1234*58b9f456SAndroid Build Coastguard Worker 1235*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1236*58b9f456SAndroid Build Coastguard Worker hasher hash_function() const {return __table_.hash_function();} 1237*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1238*58b9f456SAndroid Build Coastguard Worker key_equal key_eq() const {return __table_.key_eq();} 1239*58b9f456SAndroid Build Coastguard Worker 1240*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1241*58b9f456SAndroid Build Coastguard Worker iterator find(const key_type& __k) {return __table_.find(__k);} 1242*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1243*58b9f456SAndroid Build Coastguard Worker const_iterator find(const key_type& __k) const {return __table_.find(__k);} 1244*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1245*58b9f456SAndroid Build Coastguard Worker size_type count(const key_type& __k) const {return __table_.__count_multi(__k);} 1246*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1247*58b9f456SAndroid Build Coastguard Worker pair<iterator, iterator> equal_range(const key_type& __k) 1248*58b9f456SAndroid Build Coastguard Worker {return __table_.__equal_range_multi(__k);} 1249*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1250*58b9f456SAndroid Build Coastguard Worker pair<const_iterator, const_iterator> equal_range(const key_type& __k) const 1251*58b9f456SAndroid Build Coastguard Worker {return __table_.__equal_range_multi(__k);} 1252*58b9f456SAndroid Build Coastguard Worker 1253*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1254*58b9f456SAndroid Build Coastguard Worker size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();} 1255*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1256*58b9f456SAndroid Build Coastguard Worker size_type max_bucket_count() const _NOEXCEPT {return __table_.max_bucket_count();} 1257*58b9f456SAndroid Build Coastguard Worker 1258*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1259*58b9f456SAndroid Build Coastguard Worker size_type bucket_size(size_type __n) const {return __table_.bucket_size(__n);} 1260*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1261*58b9f456SAndroid Build Coastguard Worker size_type bucket(const key_type& __k) const {return __table_.bucket(__k);} 1262*58b9f456SAndroid Build Coastguard Worker 1263*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1264*58b9f456SAndroid Build Coastguard Worker local_iterator begin(size_type __n) {return __table_.begin(__n);} 1265*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1266*58b9f456SAndroid Build Coastguard Worker local_iterator end(size_type __n) {return __table_.end(__n);} 1267*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1268*58b9f456SAndroid Build Coastguard Worker const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);} 1269*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1270*58b9f456SAndroid Build Coastguard Worker const_local_iterator end(size_type __n) const {return __table_.cend(__n);} 1271*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1272*58b9f456SAndroid Build Coastguard Worker const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);} 1273*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1274*58b9f456SAndroid Build Coastguard Worker const_local_iterator cend(size_type __n) const {return __table_.cend(__n);} 1275*58b9f456SAndroid Build Coastguard Worker 1276*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1277*58b9f456SAndroid Build Coastguard Worker float load_factor() const _NOEXCEPT {return __table_.load_factor();} 1278*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1279*58b9f456SAndroid Build Coastguard Worker float max_load_factor() const _NOEXCEPT {return __table_.max_load_factor();} 1280*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1281*58b9f456SAndroid Build Coastguard Worker void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);} 1282*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1283*58b9f456SAndroid Build Coastguard Worker void rehash(size_type __n) {__table_.rehash(__n);} 1284*58b9f456SAndroid Build Coastguard Worker _LIBCPP_INLINE_VISIBILITY 1285*58b9f456SAndroid Build Coastguard Worker void reserve(size_type __n) {__table_.reserve(__n);} 1286*58b9f456SAndroid Build Coastguard Worker 1287*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1288*58b9f456SAndroid Build Coastguard Worker 1289*58b9f456SAndroid Build Coastguard Worker bool __dereferenceable(const const_iterator* __i) const 1290*58b9f456SAndroid Build Coastguard Worker {return __table_.__dereferenceable(__i);} 1291*58b9f456SAndroid Build Coastguard Worker bool __decrementable(const const_iterator* __i) const 1292*58b9f456SAndroid Build Coastguard Worker {return __table_.__decrementable(__i);} 1293*58b9f456SAndroid Build Coastguard Worker bool __addable(const const_iterator* __i, ptrdiff_t __n) const 1294*58b9f456SAndroid Build Coastguard Worker {return __table_.__addable(__i, __n);} 1295*58b9f456SAndroid Build Coastguard Worker bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const 1296*58b9f456SAndroid Build Coastguard Worker {return __table_.__addable(__i, __n);} 1297*58b9f456SAndroid Build Coastguard Worker 1298*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_DEBUG_LEVEL >= 2 1299*58b9f456SAndroid Build Coastguard Worker 1300*58b9f456SAndroid Build Coastguard Worker}; 1301*58b9f456SAndroid Build Coastguard Worker 1302*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1303*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1304*58b9f456SAndroid Build Coastguard Worker size_type __n, const hasher& __hf, const key_equal& __eql) 1305*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql) 1306*58b9f456SAndroid Build Coastguard Worker{ 1307*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1308*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1309*58b9f456SAndroid Build Coastguard Worker#endif 1310*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 1311*58b9f456SAndroid Build Coastguard Worker} 1312*58b9f456SAndroid Build Coastguard Worker 1313*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1314*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1315*58b9f456SAndroid Build Coastguard Worker size_type __n, const hasher& __hf, const key_equal& __eql, 1316*58b9f456SAndroid Build Coastguard Worker const allocator_type& __a) 1317*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql, __a) 1318*58b9f456SAndroid Build Coastguard Worker{ 1319*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1320*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1321*58b9f456SAndroid Build Coastguard Worker#endif 1322*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 1323*58b9f456SAndroid Build Coastguard Worker} 1324*58b9f456SAndroid Build Coastguard Worker 1325*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1326*58b9f456SAndroid Build Coastguard Workertemplate <class _InputIterator> 1327*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1328*58b9f456SAndroid Build Coastguard Worker _InputIterator __first, _InputIterator __last) 1329*58b9f456SAndroid Build Coastguard Worker{ 1330*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1331*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1332*58b9f456SAndroid Build Coastguard Worker#endif 1333*58b9f456SAndroid Build Coastguard Worker insert(__first, __last); 1334*58b9f456SAndroid Build Coastguard Worker} 1335*58b9f456SAndroid Build Coastguard Worker 1336*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1337*58b9f456SAndroid Build Coastguard Workertemplate <class _InputIterator> 1338*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1339*58b9f456SAndroid Build Coastguard Worker _InputIterator __first, _InputIterator __last, size_type __n, 1340*58b9f456SAndroid Build Coastguard Worker const hasher& __hf, const key_equal& __eql) 1341*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql) 1342*58b9f456SAndroid Build Coastguard Worker{ 1343*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1344*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1345*58b9f456SAndroid Build Coastguard Worker#endif 1346*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 1347*58b9f456SAndroid Build Coastguard Worker insert(__first, __last); 1348*58b9f456SAndroid Build Coastguard Worker} 1349*58b9f456SAndroid Build Coastguard Worker 1350*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1351*58b9f456SAndroid Build Coastguard Workertemplate <class _InputIterator> 1352*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1353*58b9f456SAndroid Build Coastguard Worker _InputIterator __first, _InputIterator __last, size_type __n, 1354*58b9f456SAndroid Build Coastguard Worker const hasher& __hf, const key_equal& __eql, const allocator_type& __a) 1355*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql, __a) 1356*58b9f456SAndroid Build Coastguard Worker{ 1357*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1358*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1359*58b9f456SAndroid Build Coastguard Worker#endif 1360*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 1361*58b9f456SAndroid Build Coastguard Worker insert(__first, __last); 1362*58b9f456SAndroid Build Coastguard Worker} 1363*58b9f456SAndroid Build Coastguard Worker 1364*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1365*58b9f456SAndroid Build Coastguard Workerinline 1366*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1367*58b9f456SAndroid Build Coastguard Worker const allocator_type& __a) 1368*58b9f456SAndroid Build Coastguard Worker : __table_(__a) 1369*58b9f456SAndroid Build Coastguard Worker{ 1370*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1371*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1372*58b9f456SAndroid Build Coastguard Worker#endif 1373*58b9f456SAndroid Build Coastguard Worker} 1374*58b9f456SAndroid Build Coastguard Worker 1375*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1376*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1377*58b9f456SAndroid Build Coastguard Worker const unordered_multiset& __u) 1378*58b9f456SAndroid Build Coastguard Worker : __table_(__u.__table_) 1379*58b9f456SAndroid Build Coastguard Worker{ 1380*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1381*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1382*58b9f456SAndroid Build Coastguard Worker#endif 1383*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__u.bucket_count()); 1384*58b9f456SAndroid Build Coastguard Worker insert(__u.begin(), __u.end()); 1385*58b9f456SAndroid Build Coastguard Worker} 1386*58b9f456SAndroid Build Coastguard Worker 1387*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1388*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1389*58b9f456SAndroid Build Coastguard Worker const unordered_multiset& __u, const allocator_type& __a) 1390*58b9f456SAndroid Build Coastguard Worker : __table_(__u.__table_, __a) 1391*58b9f456SAndroid Build Coastguard Worker{ 1392*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1393*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1394*58b9f456SAndroid Build Coastguard Worker#endif 1395*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__u.bucket_count()); 1396*58b9f456SAndroid Build Coastguard Worker insert(__u.begin(), __u.end()); 1397*58b9f456SAndroid Build Coastguard Worker} 1398*58b9f456SAndroid Build Coastguard Worker 1399*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 1400*58b9f456SAndroid Build Coastguard Worker 1401*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1402*58b9f456SAndroid Build Coastguard Workerinline 1403*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1404*58b9f456SAndroid Build Coastguard Worker unordered_multiset&& __u) 1405*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(is_nothrow_move_constructible<__table>::value) 1406*58b9f456SAndroid Build Coastguard Worker : __table_(_VSTD::move(__u.__table_)) 1407*58b9f456SAndroid Build Coastguard Worker{ 1408*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1409*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1410*58b9f456SAndroid Build Coastguard Worker __get_db()->swap(this, &__u); 1411*58b9f456SAndroid Build Coastguard Worker#endif 1412*58b9f456SAndroid Build Coastguard Worker} 1413*58b9f456SAndroid Build Coastguard Worker 1414*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1415*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1416*58b9f456SAndroid Build Coastguard Worker unordered_multiset&& __u, const allocator_type& __a) 1417*58b9f456SAndroid Build Coastguard Worker : __table_(_VSTD::move(__u.__table_), __a) 1418*58b9f456SAndroid Build Coastguard Worker{ 1419*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1420*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1421*58b9f456SAndroid Build Coastguard Worker#endif 1422*58b9f456SAndroid Build Coastguard Worker if (__a != __u.get_allocator()) 1423*58b9f456SAndroid Build Coastguard Worker { 1424*58b9f456SAndroid Build Coastguard Worker iterator __i = __u.begin(); 1425*58b9f456SAndroid Build Coastguard Worker while (__u.size() != 0) 1426*58b9f456SAndroid Build Coastguard Worker __table_.__insert_multi(_VSTD::move(__u.__table_.remove(__i++)->__value_)); 1427*58b9f456SAndroid Build Coastguard Worker } 1428*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1429*58b9f456SAndroid Build Coastguard Worker else 1430*58b9f456SAndroid Build Coastguard Worker __get_db()->swap(this, &__u); 1431*58b9f456SAndroid Build Coastguard Worker#endif 1432*58b9f456SAndroid Build Coastguard Worker} 1433*58b9f456SAndroid Build Coastguard Worker 1434*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1435*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1436*58b9f456SAndroid Build Coastguard Worker initializer_list<value_type> __il) 1437*58b9f456SAndroid Build Coastguard Worker{ 1438*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1439*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1440*58b9f456SAndroid Build Coastguard Worker#endif 1441*58b9f456SAndroid Build Coastguard Worker insert(__il.begin(), __il.end()); 1442*58b9f456SAndroid Build Coastguard Worker} 1443*58b9f456SAndroid Build Coastguard Worker 1444*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1445*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1446*58b9f456SAndroid Build Coastguard Worker initializer_list<value_type> __il, size_type __n, const hasher& __hf, 1447*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql) 1448*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql) 1449*58b9f456SAndroid Build Coastguard Worker{ 1450*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1451*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1452*58b9f456SAndroid Build Coastguard Worker#endif 1453*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 1454*58b9f456SAndroid Build Coastguard Worker insert(__il.begin(), __il.end()); 1455*58b9f456SAndroid Build Coastguard Worker} 1456*58b9f456SAndroid Build Coastguard Worker 1457*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1458*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( 1459*58b9f456SAndroid Build Coastguard Worker initializer_list<value_type> __il, size_type __n, const hasher& __hf, 1460*58b9f456SAndroid Build Coastguard Worker const key_equal& __eql, const allocator_type& __a) 1461*58b9f456SAndroid Build Coastguard Worker : __table_(__hf, __eql, __a) 1462*58b9f456SAndroid Build Coastguard Worker{ 1463*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_DEBUG_LEVEL >= 2 1464*58b9f456SAndroid Build Coastguard Worker __get_db()->__insert_c(this); 1465*58b9f456SAndroid Build Coastguard Worker#endif 1466*58b9f456SAndroid Build Coastguard Worker __table_.rehash(__n); 1467*58b9f456SAndroid Build Coastguard Worker insert(__il.begin(), __il.end()); 1468*58b9f456SAndroid Build Coastguard Worker} 1469*58b9f456SAndroid Build Coastguard Worker 1470*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1471*58b9f456SAndroid Build Coastguard Workerinline 1472*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>& 1473*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=( 1474*58b9f456SAndroid Build Coastguard Worker unordered_multiset&& __u) 1475*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(is_nothrow_move_assignable<__table>::value) 1476*58b9f456SAndroid Build Coastguard Worker{ 1477*58b9f456SAndroid Build Coastguard Worker __table_ = _VSTD::move(__u.__table_); 1478*58b9f456SAndroid Build Coastguard Worker return *this; 1479*58b9f456SAndroid Build Coastguard Worker} 1480*58b9f456SAndroid Build Coastguard Worker 1481*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1482*58b9f456SAndroid Build Coastguard Workerinline 1483*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>& 1484*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=( 1485*58b9f456SAndroid Build Coastguard Worker initializer_list<value_type> __il) 1486*58b9f456SAndroid Build Coastguard Worker{ 1487*58b9f456SAndroid Build Coastguard Worker __table_.__assign_multi(__il.begin(), __il.end()); 1488*58b9f456SAndroid Build Coastguard Worker return *this; 1489*58b9f456SAndroid Build Coastguard Worker} 1490*58b9f456SAndroid Build Coastguard Worker 1491*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_CXX03_LANG 1492*58b9f456SAndroid Build Coastguard Worker 1493*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1494*58b9f456SAndroid Build Coastguard Workertemplate <class _InputIterator> 1495*58b9f456SAndroid Build Coastguard Workerinline 1496*58b9f456SAndroid Build Coastguard Workervoid 1497*58b9f456SAndroid Build Coastguard Workerunordered_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, 1498*58b9f456SAndroid Build Coastguard Worker _InputIterator __last) 1499*58b9f456SAndroid Build Coastguard Worker{ 1500*58b9f456SAndroid Build Coastguard Worker for (; __first != __last; ++__first) 1501*58b9f456SAndroid Build Coastguard Worker __table_.__insert_multi(*__first); 1502*58b9f456SAndroid Build Coastguard Worker} 1503*58b9f456SAndroid Build Coastguard Worker 1504*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1505*58b9f456SAndroid Build Coastguard Workerinline _LIBCPP_INLINE_VISIBILITY 1506*58b9f456SAndroid Build Coastguard Workervoid 1507*58b9f456SAndroid Build Coastguard Workerswap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, 1508*58b9f456SAndroid Build Coastguard Worker unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) 1509*58b9f456SAndroid Build Coastguard Worker _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) 1510*58b9f456SAndroid Build Coastguard Worker{ 1511*58b9f456SAndroid Build Coastguard Worker __x.swap(__y); 1512*58b9f456SAndroid Build Coastguard Worker} 1513*58b9f456SAndroid Build Coastguard Worker 1514*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 17 1515*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc, class _Predicate> 1516*58b9f456SAndroid Build Coastguard Workerinline _LIBCPP_INLINE_VISIBILITY 1517*58b9f456SAndroid Build Coastguard Workervoid erase_if(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __c, _Predicate __pred) 1518*58b9f456SAndroid Build Coastguard Worker{ __libcpp_erase_if_container(__c, __pred); } 1519*58b9f456SAndroid Build Coastguard Worker#endif 1520*58b9f456SAndroid Build Coastguard Worker 1521*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1522*58b9f456SAndroid Build Coastguard Workerbool 1523*58b9f456SAndroid Build Coastguard Workeroperator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, 1524*58b9f456SAndroid Build Coastguard Worker const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) 1525*58b9f456SAndroid Build Coastguard Worker{ 1526*58b9f456SAndroid Build Coastguard Worker if (__x.size() != __y.size()) 1527*58b9f456SAndroid Build Coastguard Worker return false; 1528*58b9f456SAndroid Build Coastguard Worker typedef typename unordered_multiset<_Value, _Hash, _Pred, _Alloc>::const_iterator 1529*58b9f456SAndroid Build Coastguard Worker const_iterator; 1530*58b9f456SAndroid Build Coastguard Worker typedef pair<const_iterator, const_iterator> _EqRng; 1531*58b9f456SAndroid Build Coastguard Worker for (const_iterator __i = __x.begin(), __ex = __x.end(); __i != __ex;) 1532*58b9f456SAndroid Build Coastguard Worker { 1533*58b9f456SAndroid Build Coastguard Worker _EqRng __xeq = __x.equal_range(*__i); 1534*58b9f456SAndroid Build Coastguard Worker _EqRng __yeq = __y.equal_range(*__i); 1535*58b9f456SAndroid Build Coastguard Worker if (_VSTD::distance(__xeq.first, __xeq.second) != 1536*58b9f456SAndroid Build Coastguard Worker _VSTD::distance(__yeq.first, __yeq.second) || 1537*58b9f456SAndroid Build Coastguard Worker !_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first)) 1538*58b9f456SAndroid Build Coastguard Worker return false; 1539*58b9f456SAndroid Build Coastguard Worker __i = __xeq.second; 1540*58b9f456SAndroid Build Coastguard Worker } 1541*58b9f456SAndroid Build Coastguard Worker return true; 1542*58b9f456SAndroid Build Coastguard Worker} 1543*58b9f456SAndroid Build Coastguard Worker 1544*58b9f456SAndroid Build Coastguard Workertemplate <class _Value, class _Hash, class _Pred, class _Alloc> 1545*58b9f456SAndroid Build Coastguard Workerinline _LIBCPP_INLINE_VISIBILITY 1546*58b9f456SAndroid Build Coastguard Workerbool 1547*58b9f456SAndroid Build Coastguard Workeroperator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, 1548*58b9f456SAndroid Build Coastguard Worker const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) 1549*58b9f456SAndroid Build Coastguard Worker{ 1550*58b9f456SAndroid Build Coastguard Worker return !(__x == __y); 1551*58b9f456SAndroid Build Coastguard Worker} 1552*58b9f456SAndroid Build Coastguard Worker 1553*58b9f456SAndroid Build Coastguard Worker_LIBCPP_END_NAMESPACE_STD 1554*58b9f456SAndroid Build Coastguard Worker 1555*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_UNORDERED_SET 1556