00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _UNORDERED_SET_H
00031 #define _UNORDERED_SET_H
00032
00033 _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
00034
00035
00036
00037 template<class _Value,
00038 class _Hash = hash<_Value>,
00039 class _Pred = std::equal_to<_Value>,
00040 class _Alloc = std::allocator<_Value>,
00041 bool __cache_hash_code = false>
00042 class __unordered_set
00043 : public _Hashtable<_Value, _Value, _Alloc,
00044 std::_Identity<_Value>, _Pred,
00045 _Hash, __detail::_Mod_range_hashing,
00046 __detail::_Default_ranged_hash,
00047 __detail::_Prime_rehash_policy,
00048 __cache_hash_code, true, true>
00049 {
00050 typedef _Hashtable<_Value, _Value, _Alloc,
00051 std::_Identity<_Value>, _Pred,
00052 _Hash, __detail::_Mod_range_hashing,
00053 __detail::_Default_ranged_hash,
00054 __detail::_Prime_rehash_policy,
00055 __cache_hash_code, true, true>
00056 _Base;
00057
00058 public:
00059 typedef typename _Base::size_type size_type;
00060 typedef typename _Base::hasher hasher;
00061 typedef typename _Base::key_equal key_equal;
00062 typedef typename _Base::allocator_type allocator_type;
00063
00064 explicit
00065 __unordered_set(size_type __n = 10,
00066 const hasher& __hf = hasher(),
00067 const key_equal& __eql = key_equal(),
00068 const allocator_type& __a = allocator_type())
00069 : _Base(__n, __hf, __detail::_Mod_range_hashing(),
00070 __detail::_Default_ranged_hash(), __eql,
00071 std::_Identity<_Value>(), __a)
00072 { }
00073
00074 template<typename _InputIterator>
00075 __unordered_set(_InputIterator __f, _InputIterator __l,
00076 size_type __n = 10,
00077 const hasher& __hf = hasher(),
00078 const key_equal& __eql = key_equal(),
00079 const allocator_type& __a = allocator_type())
00080 : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
00081 __detail::_Default_ranged_hash(), __eql,
00082 std::_Identity<_Value>(), __a)
00083 { }
00084
00085 __unordered_set(__unordered_set&& __x)
00086 : _Base(std::forward<_Base>(__x)) { }
00087 };
00088
00089 template<class _Value,
00090 class _Hash = hash<_Value>,
00091 class _Pred = std::equal_to<_Value>,
00092 class _Alloc = std::allocator<_Value>,
00093 bool __cache_hash_code = false>
00094 class __unordered_multiset
00095 : public _Hashtable<_Value, _Value, _Alloc,
00096 std::_Identity<_Value>, _Pred,
00097 _Hash, __detail::_Mod_range_hashing,
00098 __detail::_Default_ranged_hash,
00099 __detail::_Prime_rehash_policy,
00100 __cache_hash_code, true, false>
00101 {
00102 typedef _Hashtable<_Value, _Value, _Alloc,
00103 std::_Identity<_Value>, _Pred,
00104 _Hash, __detail::_Mod_range_hashing,
00105 __detail::_Default_ranged_hash,
00106 __detail::_Prime_rehash_policy,
00107 __cache_hash_code, true, false>
00108 _Base;
00109
00110 public:
00111 typedef typename _Base::size_type size_type;
00112 typedef typename _Base::hasher hasher;
00113 typedef typename _Base::key_equal key_equal;
00114 typedef typename _Base::allocator_type allocator_type;
00115
00116 explicit
00117 __unordered_multiset(size_type __n = 10,
00118 const hasher& __hf = hasher(),
00119 const key_equal& __eql = key_equal(),
00120 const allocator_type& __a = allocator_type())
00121 : _Base(__n, __hf, __detail::_Mod_range_hashing(),
00122 __detail::_Default_ranged_hash(), __eql,
00123 std::_Identity<_Value>(), __a)
00124 { }
00125
00126
00127 template<typename _InputIterator>
00128 __unordered_multiset(_InputIterator __f, _InputIterator __l,
00129 typename _Base::size_type __n = 0,
00130 const hasher& __hf = hasher(),
00131 const key_equal& __eql = key_equal(),
00132 const allocator_type& __a = allocator_type())
00133 : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
00134 __detail::_Default_ranged_hash(), __eql,
00135 std::_Identity<_Value>(), __a)
00136 { }
00137
00138 __unordered_multiset(__unordered_multiset&& __x)
00139 : _Base(std::forward<_Base>(__x)) { }
00140 };
00141
00142 template<class _Value, class _Hash, class _Pred, class _Alloc,
00143 bool __cache_hash_code>
00144 inline void
00145 swap(__unordered_set<_Value, _Hash, _Pred, _Alloc, __cache_hash_code>& __x,
00146 __unordered_set<_Value, _Hash, _Pred, _Alloc, __cache_hash_code>& __y)
00147 { __x.swap(__y); }
00148
00149 template<class _Value, class _Hash, class _Pred, class _Alloc,
00150 bool __cache_hash_code>
00151 inline void
00152 swap(__unordered_multiset<_Value, _Hash, _Pred,
00153 _Alloc, __cache_hash_code>& __x,
00154 __unordered_multiset<_Value, _Hash, _Pred,
00155 _Alloc, __cache_hash_code>& __y)
00156 { __x.swap(__y); }
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 template<class _Value,
00175 class _Hash = hash<_Value>,
00176 class _Pred = std::equal_to<_Value>,
00177 class _Alloc = std::allocator<_Value> >
00178 class unordered_set
00179 : public __unordered_set<_Value, _Hash, _Pred, _Alloc>
00180 {
00181 typedef __unordered_set<_Value, _Hash, _Pred, _Alloc> _Base;
00182
00183 public:
00184 typedef typename _Base::value_type value_type;
00185 typedef typename _Base::size_type size_type;
00186 typedef typename _Base::hasher hasher;
00187 typedef typename _Base::key_equal key_equal;
00188 typedef typename _Base::allocator_type allocator_type;
00189
00190 explicit
00191 unordered_set(size_type __n = 10,
00192 const hasher& __hf = hasher(),
00193 const key_equal& __eql = key_equal(),
00194 const allocator_type& __a = allocator_type())
00195 : _Base(__n, __hf, __eql, __a)
00196 { }
00197
00198 template<typename _InputIterator>
00199 unordered_set(_InputIterator __f, _InputIterator __l,
00200 size_type __n = 10,
00201 const hasher& __hf = hasher(),
00202 const key_equal& __eql = key_equal(),
00203 const allocator_type& __a = allocator_type())
00204 : _Base(__f, __l, __n, __hf, __eql, __a)
00205 { }
00206
00207 unordered_set(unordered_set&& __x)
00208 : _Base(std::forward<_Base>(__x)) { }
00209
00210 unordered_set(initializer_list<value_type> __l,
00211 size_type __n = 10,
00212 const hasher& __hf = hasher(),
00213 const key_equal& __eql = key_equal(),
00214 const allocator_type& __a = allocator_type())
00215 : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
00216 { }
00217
00218 unordered_set&
00219 operator=(unordered_set&& __x)
00220 {
00221
00222
00223 this->clear();
00224 this->swap(__x);
00225 return *this;
00226 }
00227
00228 unordered_set&
00229 operator=(initializer_list<value_type> __l)
00230 {
00231 this->clear();
00232 this->insert(__l.begin(), __l.end());
00233 return *this;
00234 }
00235 };
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252 template<class _Value,
00253 class _Hash = hash<_Value>,
00254 class _Pred = std::equal_to<_Value>,
00255 class _Alloc = std::allocator<_Value> >
00256 class unordered_multiset
00257 : public __unordered_multiset<_Value, _Hash, _Pred, _Alloc>
00258 {
00259 typedef __unordered_multiset<_Value, _Hash, _Pred, _Alloc> _Base;
00260
00261 public:
00262 typedef typename _Base::value_type value_type;
00263 typedef typename _Base::size_type size_type;
00264 typedef typename _Base::hasher hasher;
00265 typedef typename _Base::key_equal key_equal;
00266 typedef typename _Base::allocator_type allocator_type;
00267
00268 explicit
00269 unordered_multiset(size_type __n = 10,
00270 const hasher& __hf = hasher(),
00271 const key_equal& __eql = key_equal(),
00272 const allocator_type& __a = allocator_type())
00273 : _Base(__n, __hf, __eql, __a)
00274 { }
00275
00276
00277 template<typename _InputIterator>
00278 unordered_multiset(_InputIterator __f, _InputIterator __l,
00279 typename _Base::size_type __n = 0,
00280 const hasher& __hf = hasher(),
00281 const key_equal& __eql = key_equal(),
00282 const allocator_type& __a = allocator_type())
00283 : _Base(__f, __l, __n, __hf, __eql, __a)
00284 { }
00285
00286 unordered_multiset(unordered_multiset&& __x)
00287 : _Base(std::forward<_Base>(__x)) { }
00288
00289 unordered_multiset(initializer_list<value_type> __l,
00290 size_type __n = 10,
00291 const hasher& __hf = hasher(),
00292 const key_equal& __eql = key_equal(),
00293 const allocator_type& __a = allocator_type())
00294 : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
00295 { }
00296
00297 unordered_multiset&
00298 operator=(unordered_multiset&& __x)
00299 {
00300
00301
00302 this->clear();
00303 this->swap(__x);
00304 return *this;
00305 }
00306
00307 unordered_multiset&
00308 operator=(initializer_list<value_type> __l)
00309 {
00310 this->clear();
00311 this->insert(__l.begin(), __l.end());
00312 return *this;
00313 }
00314 };
00315
00316 template<class _Value, class _Hash, class _Pred, class _Alloc>
00317 inline void
00318 swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
00319 unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
00320 { __x.swap(__y); }
00321
00322 template<class _Value, class _Hash, class _Pred, class _Alloc>
00323 inline void
00324 swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
00325 unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
00326 { __x.swap(__y); }
00327
00328 _GLIBCXX_END_NESTED_NAMESPACE
00329
00330 #endif
00331