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