1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/tools/stlport/stl/_hash_set.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,483 @@
1.4 +/*
1.5 + *
1.6 + * Copyright (c) 1994
1.7 + * Hewlett-Packard Company
1.8 + *
1.9 + * Copyright (c) 1996,1997
1.10 + * Silicon Graphics Computer Systems, Inc.
1.11 + *
1.12 + * Copyright (c) 1997
1.13 + * Moscow Center for SPARC Technology
1.14 + *
1.15 + * Copyright (c) 1999
1.16 + * Boris Fomitchev
1.17 + *
1.18 + * This material is provided "as is", with absolutely no warranty expressed
1.19 + * or implied. Any use is at your own risk.
1.20 + *
1.21 + * Permission to use or copy this software for any purpose is hereby granted
1.22 + * without fee, provided the above notices are retained on all copies.
1.23 + * Permission to modify the code and to distribute modified code is granted,
1.24 + * provided the above notices are retained, and a notice that the code was
1.25 + * modified is included with the above copyright notice.
1.26 + *
1.27 + */
1.28 +
1.29 +/* NOTE: This is an internal header file, included by other STL headers.
1.30 + * You should not attempt to use it directly.
1.31 + */
1.32 +
1.33 +#ifndef _STLP_INTERNAL_HASH_SET_H
1.34 +#define _STLP_INTERNAL_HASH_SET_H
1.35 +
1.36 +#ifndef _STLP_INTERNAL_HASHTABLE_H
1.37 +# include <stl/_hashtable.h>
1.38 +#endif
1.39 +
1.40 +_STLP_BEGIN_NAMESPACE
1.41 +
1.42 +//Specific iterator traits creation
1.43 +_STLP_CREATE_HASH_ITERATOR_TRAITS(HashSetTraitsT, Const_traits)
1.44 +
1.45 +template <class _Value, _STLP_DFL_TMPL_PARAM(_HashFcn,hash<_Value>),
1.46 + _STLP_DFL_TMPL_PARAM(_EqualKey,equal_to<_Value>),
1.47 + _STLP_DEFAULT_ALLOCATOR_SELECT(_Value) >
1.48 +class hash_set
1.49 +#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
1.50 + : public __stlport_class<hash_set<_Value, _HashFcn, _EqualKey, _Alloc> >
1.51 +#endif
1.52 +{
1.53 + typedef hash_set<_Value, _HashFcn, _EqualKey, _Alloc> _Self;
1.54 + //Specific iterator traits creation
1.55 + typedef _STLP_PRIV _HashSetTraitsT<_Value> _HashSetTraits;
1.56 +public:
1.57 + typedef hashtable<_Value, _Value, _HashFcn,
1.58 + _HashSetTraits, _STLP_PRIV _Identity<_Value>, _EqualKey, _Alloc> _Ht;
1.59 +public:
1.60 + typedef typename _Ht::key_type key_type;
1.61 + typedef typename _Ht::value_type value_type;
1.62 + typedef typename _Ht::hasher hasher;
1.63 + typedef typename _Ht::key_equal key_equal;
1.64 +
1.65 + typedef typename _Ht::size_type size_type;
1.66 + typedef typename _Ht::difference_type difference_type;
1.67 + typedef typename _Ht::pointer pointer;
1.68 + typedef typename _Ht::const_pointer const_pointer;
1.69 + typedef typename _Ht::reference reference;
1.70 + typedef typename _Ht::const_reference const_reference;
1.71 +
1.72 + typedef typename _Ht::iterator iterator;
1.73 + typedef typename _Ht::const_iterator const_iterator;
1.74 +
1.75 + typedef typename _Ht::allocator_type allocator_type;
1.76 +
1.77 + hasher hash_funct() const { return _M_ht.hash_funct(); }
1.78 + key_equal key_eq() const { return _M_ht.key_eq(); }
1.79 + allocator_type get_allocator() const { return _M_ht.get_allocator(); }
1.80 +
1.81 +private:
1.82 + _Ht _M_ht;
1.83 + _STLP_KEY_TYPE_FOR_CONT_EXT(key_type)
1.84 +
1.85 +public:
1.86 + hash_set()
1.87 + : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
1.88 + explicit hash_set(size_type __n)
1.89 + : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
1.90 + hash_set(size_type __n, const hasher& __hf)
1.91 + : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
1.92 +#if !defined (_STLP_DONT_SUP_DFLT_PARAM)
1.93 + hash_set(size_type __n, const hasher& __hf, const key_equal& __eql,
1.94 + const allocator_type& __a = allocator_type())
1.95 +#else
1.96 + hash_set(size_type __n, const hasher& __hf, const key_equal& __eql)
1.97 + : _M_ht(__n, __hf, __eql, allocator_type()) {}
1.98 + hash_set(size_type __n, const hasher& __hf, const key_equal& __eql,
1.99 + const allocator_type& __a)
1.100 +#endif
1.101 + : _M_ht(__n, __hf, __eql, __a) {}
1.102 +
1.103 + hash_set(__move_source<_Self> src)
1.104 + : _M_ht(__move_source<_Ht>(src.get()._M_ht)) {}
1.105 +
1.106 +#if defined (_STLP_MEMBER_TEMPLATES)
1.107 + template <class _InputIterator>
1.108 + hash_set(_InputIterator __f, _InputIterator __l)
1.109 + : _M_ht(100, hasher(), key_equal(), allocator_type())
1.110 + { _M_ht.insert_unique(__f, __l); }
1.111 + template <class _InputIterator>
1.112 + hash_set(_InputIterator __f, _InputIterator __l, size_type __n)
1.113 + : _M_ht(__n, hasher(), key_equal(), allocator_type())
1.114 + { _M_ht.insert_unique(__f, __l); }
1.115 + template <class _InputIterator>
1.116 + hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
1.117 + const hasher& __hf)
1.118 + : _M_ht(__n, __hf, key_equal(), allocator_type())
1.119 + { _M_ht.insert_unique(__f, __l); }
1.120 + template <class _InputIterator>
1.121 + hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
1.122 + const hasher& __hf, const key_equal& __eql,
1.123 + const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL)
1.124 + : _M_ht(__n, __hf, __eql, __a)
1.125 + { _M_ht.insert_unique(__f, __l); }
1.126 +# if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS)
1.127 + template <class _InputIterator>
1.128 + hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
1.129 + const hasher& __hf, const key_equal& __eql)
1.130 + : _M_ht(__n, __hf, __eql, allocator_type())
1.131 + { _M_ht.insert_unique(__f, __l); }
1.132 +# endif
1.133 +#else
1.134 + hash_set(const value_type* __f, const value_type* __l)
1.135 + : _M_ht(100, hasher(), key_equal(), allocator_type())
1.136 + { _M_ht.insert_unique(__f, __l); }
1.137 + hash_set(const value_type* __f, const value_type* __l, size_type __n)
1.138 + : _M_ht(__n, hasher(), key_equal(), allocator_type())
1.139 + { _M_ht.insert_unique(__f, __l); }
1.140 + hash_set(const value_type* __f, const value_type* __l, size_type __n,
1.141 + const hasher& __hf)
1.142 + : _M_ht(__n, __hf, key_equal(), allocator_type())
1.143 + { _M_ht.insert_unique(__f, __l); }
1.144 + hash_set(const value_type* __f, const value_type* __l, size_type __n,
1.145 + const hasher& __hf, const key_equal& __eql,
1.146 + const allocator_type& __a = allocator_type())
1.147 + : _M_ht(__n, __hf, __eql, __a)
1.148 + { _M_ht.insert_unique(__f, __l); }
1.149 +
1.150 + hash_set(const_iterator __f, const_iterator __l)
1.151 + : _M_ht(100, hasher(), key_equal(), allocator_type())
1.152 + { _M_ht.insert_unique(__f, __l); }
1.153 + hash_set(const_iterator __f, const_iterator __l, size_type __n)
1.154 + : _M_ht(__n, hasher(), key_equal(), allocator_type())
1.155 + { _M_ht.insert_unique(__f, __l); }
1.156 + hash_set(const_iterator __f, const_iterator __l, size_type __n,
1.157 + const hasher& __hf)
1.158 + : _M_ht(__n, __hf, key_equal(), allocator_type())
1.159 + { _M_ht.insert_unique(__f, __l); }
1.160 + hash_set(const_iterator __f, const_iterator __l, size_type __n,
1.161 + const hasher& __hf, const key_equal& __eql,
1.162 + const allocator_type& __a = allocator_type())
1.163 + : _M_ht(__n, __hf, __eql, __a)
1.164 + { _M_ht.insert_unique(__f, __l); }
1.165 +#endif /*_STLP_MEMBER_TEMPLATES */
1.166 +
1.167 +public:
1.168 + size_type size() const { return _M_ht.size(); }
1.169 + size_type max_size() const { return _M_ht.max_size(); }
1.170 + bool empty() const { return _M_ht.empty(); }
1.171 + void swap(_Self& __hs) { _M_ht.swap(__hs._M_ht); }
1.172 +
1.173 + iterator begin() { return _M_ht.begin(); }
1.174 + iterator end() { return _M_ht.end(); }
1.175 + const_iterator begin() const { return _M_ht.begin(); }
1.176 + const_iterator end() const { return _M_ht.end(); }
1.177 +
1.178 +public:
1.179 + pair<iterator, bool> insert(const value_type& __obj)
1.180 + { return _M_ht.insert_unique(__obj); }
1.181 +#if defined (_STLP_MEMBER_TEMPLATES)
1.182 + template <class _InputIterator>
1.183 + void insert(_InputIterator __f, _InputIterator __l)
1.184 +#else
1.185 + void insert(const_iterator __f, const_iterator __l)
1.186 + {_M_ht.insert_unique(__f, __l); }
1.187 + void insert(const value_type* __f, const value_type* __l)
1.188 +#endif
1.189 + { _M_ht.insert_unique(__f,__l); }
1.190 +
1.191 + pair<iterator, bool> insert_noresize(const value_type& __obj)
1.192 + { return _M_ht.insert_unique_noresize(__obj); }
1.193 +
1.194 + _STLP_TEMPLATE_FOR_CONT_EXT
1.195 + iterator find(const _KT& __key) { return _M_ht.find(__key); }
1.196 + _STLP_TEMPLATE_FOR_CONT_EXT
1.197 + const_iterator find(const _KT& __key) const { return _M_ht.find(__key); }
1.198 +
1.199 + _STLP_TEMPLATE_FOR_CONT_EXT
1.200 + size_type count(const _KT& __key) const { return _M_ht.count(__key); }
1.201 +
1.202 + _STLP_TEMPLATE_FOR_CONT_EXT
1.203 + pair<iterator, iterator> equal_range(const _KT& __key)
1.204 + { return _M_ht.equal_range(__key); }
1.205 + _STLP_TEMPLATE_FOR_CONT_EXT
1.206 + pair<const_iterator, const_iterator> equal_range(const _KT& __key) const
1.207 + { return _M_ht.equal_range(__key); }
1.208 +
1.209 + _STLP_TEMPLATE_FOR_CONT_EXT
1.210 + size_type erase(const _KT& __key) {return _M_ht.erase(__key); }
1.211 + void erase(iterator __it) { _M_ht.erase(__it); }
1.212 + void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
1.213 + void clear() { _M_ht.clear(); }
1.214 +
1.215 +public:
1.216 + void resize(size_type __hint) { _M_ht.resize(__hint); }
1.217 + size_type bucket_count() const { return _M_ht.bucket_count(); }
1.218 + size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
1.219 + size_type elems_in_bucket(size_type __n) const
1.220 + { return _M_ht.elems_in_bucket(__n); }
1.221 +};
1.222 +
1.223 +//Specific iterator traits creation
1.224 +_STLP_CREATE_HASH_ITERATOR_TRAITS(HashMultisetTraitsT, Const_traits)
1.225 +
1.226 +template <class _Value, _STLP_DFL_TMPL_PARAM(_HashFcn,hash<_Value>),
1.227 + _STLP_DFL_TMPL_PARAM(_EqualKey,equal_to<_Value>),
1.228 + _STLP_DEFAULT_ALLOCATOR_SELECT(_Value) >
1.229 +class hash_multiset
1.230 +#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
1.231 + : public __stlport_class<hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> >
1.232 +#endif
1.233 +{
1.234 + typedef hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> _Self;
1.235 + //Specific iterator traits creation
1.236 + typedef _STLP_PRIV _HashMultisetTraitsT<_Value> _HashMultisetTraits;
1.237 +public:
1.238 + typedef hashtable<_Value, _Value, _HashFcn,
1.239 + _HashMultisetTraits, _STLP_PRIV _Identity<_Value>, _EqualKey, _Alloc> _Ht;
1.240 +
1.241 + typedef typename _Ht::key_type key_type;
1.242 + typedef typename _Ht::value_type value_type;
1.243 + typedef typename _Ht::hasher hasher;
1.244 + typedef typename _Ht::key_equal key_equal;
1.245 +
1.246 + typedef typename _Ht::size_type size_type;
1.247 + typedef typename _Ht::difference_type difference_type;
1.248 + typedef typename _Ht::pointer pointer;
1.249 + typedef typename _Ht::const_pointer const_pointer;
1.250 + typedef typename _Ht::reference reference;
1.251 + typedef typename _Ht::const_reference const_reference;
1.252 +
1.253 + typedef typename _Ht::iterator iterator;
1.254 + typedef typename _Ht::const_iterator const_iterator;
1.255 +
1.256 + typedef typename _Ht::allocator_type allocator_type;
1.257 +
1.258 + hasher hash_funct() const { return _M_ht.hash_funct(); }
1.259 + key_equal key_eq() const { return _M_ht.key_eq(); }
1.260 + allocator_type get_allocator() const { return _M_ht.get_allocator(); }
1.261 +
1.262 +private:
1.263 + _Ht _M_ht;
1.264 + _STLP_KEY_TYPE_FOR_CONT_EXT(key_type)
1.265 +
1.266 +public:
1.267 + hash_multiset()
1.268 + : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
1.269 + explicit hash_multiset(size_type __n)
1.270 + : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
1.271 + hash_multiset(size_type __n, const hasher& __hf)
1.272 + : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
1.273 + hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql)
1.274 + : _M_ht(__n, __hf, __eql, allocator_type()) {}
1.275 + hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql,
1.276 + const allocator_type& __a)
1.277 + : _M_ht(__n, __hf, __eql, __a) {}
1.278 +
1.279 + hash_multiset(__move_source<_Self> src)
1.280 + : _M_ht(__move_source<_Ht>(src.get()._M_ht)) {}
1.281 +
1.282 +#if defined (_STLP_MEMBER_TEMPLATES)
1.283 + template <class _InputIterator>
1.284 + hash_multiset(_InputIterator __f, _InputIterator __l)
1.285 + : _M_ht(100, hasher(), key_equal(), allocator_type())
1.286 + { _M_ht.insert_equal(__f, __l); }
1.287 + template <class _InputIterator>
1.288 + hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n)
1.289 + : _M_ht(__n, hasher(), key_equal(), allocator_type())
1.290 + { _M_ht.insert_equal(__f, __l); }
1.291 + template <class _InputIterator>
1.292 + hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
1.293 + const hasher& __hf)
1.294 + : _M_ht(__n, __hf, key_equal(), allocator_type())
1.295 + { _M_ht.insert_equal(__f, __l); }
1.296 +
1.297 + template <class _InputIterator>
1.298 + hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
1.299 + const hasher& __hf, const key_equal& __eql,
1.300 + const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL)
1.301 + : _M_ht(__n, __hf, __eql, __a)
1.302 + { _M_ht.insert_equal(__f, __l); }
1.303 +# if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS)
1.304 + template <class _InputIterator>
1.305 + hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
1.306 + const hasher& __hf, const key_equal& __eql)
1.307 + : _M_ht(__n, __hf, __eql, allocator_type())
1.308 + { _M_ht.insert_equal(__f, __l); }
1.309 +# endif
1.310 +#else
1.311 + hash_multiset(const value_type* __f, const value_type* __l)
1.312 + : _M_ht(100, hasher(), key_equal(), allocator_type())
1.313 + { _M_ht.insert_equal(__f, __l); }
1.314 + hash_multiset(const value_type* __f, const value_type* __l, size_type __n)
1.315 + : _M_ht(__n, hasher(), key_equal(), allocator_type())
1.316 + { _M_ht.insert_equal(__f, __l); }
1.317 + hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
1.318 + const hasher& __hf)
1.319 + : _M_ht(__n, __hf, key_equal(), allocator_type())
1.320 + { _M_ht.insert_equal(__f, __l); }
1.321 + hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
1.322 + const hasher& __hf, const key_equal& __eql,
1.323 + const allocator_type& __a = allocator_type())
1.324 + : _M_ht(__n, __hf, __eql, __a)
1.325 + { _M_ht.insert_equal(__f, __l); }
1.326 +
1.327 + hash_multiset(const_iterator __f, const_iterator __l)
1.328 + : _M_ht(100, hasher(), key_equal(), allocator_type())
1.329 + { _M_ht.insert_equal(__f, __l); }
1.330 + hash_multiset(const_iterator __f, const_iterator __l, size_type __n)
1.331 + : _M_ht(__n, hasher(), key_equal(), allocator_type())
1.332 + { _M_ht.insert_equal(__f, __l); }
1.333 + hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
1.334 + const hasher& __hf)
1.335 + : _M_ht(__n, __hf, key_equal(), allocator_type())
1.336 + { _M_ht.insert_equal(__f, __l); }
1.337 + hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
1.338 + const hasher& __hf, const key_equal& __eql,
1.339 + const allocator_type& __a = allocator_type())
1.340 + : _M_ht(__n, __hf, __eql, __a)
1.341 + { _M_ht.insert_equal(__f, __l); }
1.342 +#endif /*_STLP_MEMBER_TEMPLATES */
1.343 +
1.344 +public:
1.345 + size_type size() const { return _M_ht.size(); }
1.346 + size_type max_size() const { return _M_ht.max_size(); }
1.347 + bool empty() const { return _M_ht.empty(); }
1.348 + void swap(_Self& hs) { _M_ht.swap(hs._M_ht); }
1.349 +
1.350 + iterator begin() { return _M_ht.begin(); }
1.351 + iterator end() { return _M_ht.end(); }
1.352 + const_iterator begin() const { return _M_ht.begin(); }
1.353 + const_iterator end() const { return _M_ht.end(); }
1.354 +
1.355 +public:
1.356 + iterator insert(const value_type& __obj) { return _M_ht.insert_equal(__obj); }
1.357 +#if defined (_STLP_MEMBER_TEMPLATES)
1.358 + template <class _InputIterator>
1.359 + void insert(_InputIterator __f, _InputIterator __l)
1.360 + { _M_ht.insert_equal(__f,__l); }
1.361 +#else
1.362 + void insert(const value_type* __f, const value_type* __l)
1.363 + { _M_ht.insert_equal(__f,__l); }
1.364 + void insert(const_iterator __f, const_iterator __l)
1.365 + { _M_ht.insert_equal(__f, __l); }
1.366 +#endif /*_STLP_MEMBER_TEMPLATES */
1.367 + iterator insert_noresize(const value_type& __obj)
1.368 + { return _M_ht.insert_equal_noresize(__obj); }
1.369 +
1.370 + _STLP_TEMPLATE_FOR_CONT_EXT
1.371 + iterator find(const _KT& __key) { return _M_ht.find(__key); }
1.372 +
1.373 + _STLP_TEMPLATE_FOR_CONT_EXT
1.374 + const_iterator find(const _KT& __key) const { return _M_ht.find(__key); }
1.375 +
1.376 + _STLP_TEMPLATE_FOR_CONT_EXT
1.377 + size_type count(const _KT& __key) const { return _M_ht.count(__key); }
1.378 +
1.379 + _STLP_TEMPLATE_FOR_CONT_EXT
1.380 + pair<iterator, iterator> equal_range(const _KT& __key)
1.381 + { return _M_ht.equal_range(__key); }
1.382 + _STLP_TEMPLATE_FOR_CONT_EXT
1.383 + pair<const_iterator, const_iterator> equal_range(const _KT& __key) const
1.384 + { return _M_ht.equal_range(__key); }
1.385 +
1.386 + _STLP_TEMPLATE_FOR_CONT_EXT
1.387 + size_type erase(const _KT& __key) {return _M_ht.erase(__key); }
1.388 + void erase(iterator __it) { _M_ht.erase(__it); }
1.389 + void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
1.390 + void clear() { _M_ht.clear(); }
1.391 +
1.392 +public:
1.393 + void resize(size_type __hint) { _M_ht.resize(__hint); }
1.394 + size_type bucket_count() const { return _M_ht.bucket_count(); }
1.395 + size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
1.396 + size_type elems_in_bucket(size_type __n) const
1.397 + { return _M_ht.elems_in_bucket(__n); }
1.398 +};
1.399 +
1.400 +#define _STLP_TEMPLATE_HEADER template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
1.401 +#define _STLP_TEMPLATE_CONTAINER hash_set<_Value,_HashFcn,_EqualKey,_Alloc>
1.402 +
1.403 +#include <stl/_relops_hash_cont.h>
1.404 +
1.405 +#undef _STLP_TEMPLATE_CONTAINER
1.406 +#define _STLP_TEMPLATE_CONTAINER hash_multiset<_Value,_HashFcn,_EqualKey,_Alloc>
1.407 +#include <stl/_relops_hash_cont.h>
1.408 +
1.409 +#undef _STLP_TEMPLATE_CONTAINER
1.410 +#undef _STLP_TEMPLATE_HEADER
1.411 +
1.412 +// Specialization of insert_iterator so that it will work for hash_set
1.413 +// and hash_multiset.
1.414 +
1.415 +#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
1.416 +template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
1.417 +struct __move_traits<hash_set<_Value, _HashFcn, _EqualKey, _Alloc> > :
1.418 + _STLP_PRIV __move_traits_aux<typename hash_set<_Value, _HashFcn, _EqualKey, _Alloc>::_Ht>
1.419 +{};
1.420 +
1.421 +template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
1.422 +struct __move_traits<hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> > :
1.423 + _STLP_PRIV __move_traits_aux<typename hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>::_Ht>
1.424 +{};
1.425 +
1.426 +template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
1.427 +class insert_iterator<hash_set<_Value, _HashFcn, _EqualKey, _Alloc> > {
1.428 +protected:
1.429 + typedef hash_set<_Value, _HashFcn, _EqualKey, _Alloc> _Container;
1.430 + _Container* container;
1.431 +public:
1.432 + typedef _Container container_type;
1.433 + typedef output_iterator_tag iterator_category;
1.434 + typedef void value_type;
1.435 + typedef void difference_type;
1.436 + typedef void pointer;
1.437 + typedef void reference;
1.438 +
1.439 + insert_iterator(_Container& __x) : container(&__x) {}
1.440 + insert_iterator(_Container& __x, typename _Container::iterator)
1.441 + : container(&__x) {}
1.442 + insert_iterator<_Container>&
1.443 + operator=(const typename _Container::value_type& __val) {
1.444 + container->insert(__val);
1.445 + return *this;
1.446 + }
1.447 + insert_iterator<_Container>& operator*() { return *this; }
1.448 + insert_iterator<_Container>& operator++() { return *this; }
1.449 + insert_iterator<_Container>& operator++(int) { return *this; }
1.450 +};
1.451 +
1.452 +template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
1.453 +class insert_iterator<hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> > {
1.454 +protected:
1.455 + typedef hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> _Container;
1.456 + _Container* container;
1.457 + typename _Container::iterator iter;
1.458 +public:
1.459 + typedef _Container container_type;
1.460 + typedef output_iterator_tag iterator_category;
1.461 + typedef void value_type;
1.462 + typedef void difference_type;
1.463 + typedef void pointer;
1.464 + typedef void reference;
1.465 +
1.466 + insert_iterator(_Container& __x) : container(&__x) {}
1.467 + insert_iterator(_Container& __x, typename _Container::iterator)
1.468 + : container(&__x) {}
1.469 + insert_iterator<_Container>&
1.470 + operator=(const typename _Container::value_type& __val) {
1.471 + container->insert(__val);
1.472 + return *this;
1.473 + }
1.474 + insert_iterator<_Container>& operator*() { return *this; }
1.475 + insert_iterator<_Container>& operator++() { return *this; }
1.476 + insert_iterator<_Container>& operator++(int) { return *this; }
1.477 +};
1.478 +#endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */
1.479 +
1.480 +_STLP_END_NAMESPACE
1.481 +
1.482 +#endif /* _STLP_INTERNAL_HASH_SET_H */
1.483 +
1.484 +// Local Variables:
1.485 +// mode:C++
1.486 +// End: