epoc32/include/stdapis/stlportv5/stl/_hash_map.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_hash_map.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,500 @@
     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_MAP_H
    1.34 +#define _STLP_INTERNAL_HASH_MAP_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(HashMapTraitsT, traits)
    1.44 +
    1.45 +template <class _Key, class _Tp, _STLP_DFL_TMPL_PARAM(_HashFcn,hash<_Key>),
    1.46 +          _STLP_DFL_TMPL_PARAM(_EqualKey,equal_to<_Key>),
    1.47 +          _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(const _Key, _Tp) >
    1.48 +class hash_map
    1.49 +#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
    1.50 +               : public __stlport_class<hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> >
    1.51 +#endif
    1.52 +{
    1.53 +private:
    1.54 +  typedef hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> _Self;
    1.55 +public:
    1.56 +  typedef _Key key_type;
    1.57 +  typedef _Tp data_type;
    1.58 +  typedef _Tp mapped_type;
    1.59 +#if !defined (__DMC__)
    1.60 +  typedef pair<const key_type, data_type> value_type;
    1.61 +#else
    1.62 +  /* DMC goes too far in template instanciation and tries to fully instanciate
    1.63 +   * slist<pair<const int, string> > for instance. The generation of assignment
    1.64 +   * operator fails of course so we are force to use mutable key for this compiler.
    1.65 +   */
    1.66 +  typedef pair<key_type, data_type> value_type;
    1.67 +#endif
    1.68 +private:
    1.69 +  //Specific iterator traits creation
    1.70 +  typedef _STLP_PRIV _HashMapTraitsT<value_type> _HashMapTraits;
    1.71 +
    1.72 +public:
    1.73 +  typedef hashtable<value_type, key_type, _HashFcn, _HashMapTraits,
    1.74 +                    _STLP_SELECT1ST(value_type, _Key), _EqualKey, _Alloc > _Ht;
    1.75 +
    1.76 +  typedef typename _Ht::hasher hasher;
    1.77 +  typedef typename _Ht::key_equal key_equal;
    1.78 +
    1.79 +  typedef typename _Ht::size_type size_type;
    1.80 +  typedef typename _Ht::difference_type difference_type;
    1.81 +  typedef typename _Ht::pointer pointer;
    1.82 +  typedef typename _Ht::const_pointer const_pointer;
    1.83 +  typedef typename _Ht::reference reference;
    1.84 +  typedef typename _Ht::const_reference const_reference;
    1.85 +
    1.86 +  typedef typename _Ht::iterator iterator;
    1.87 +  typedef typename _Ht::const_iterator const_iterator;
    1.88 +
    1.89 +  typedef typename _Ht::allocator_type allocator_type;
    1.90 +
    1.91 +  hasher hash_funct() const { return _M_ht.hash_funct(); }
    1.92 +  key_equal key_eq() const { return _M_ht.key_eq(); }
    1.93 +  allocator_type get_allocator() const { return _M_ht.get_allocator(); }
    1.94 +
    1.95 +private:
    1.96 +  _Ht _M_ht;
    1.97 +  _STLP_KEY_TYPE_FOR_CONT_EXT(key_type)
    1.98 +public:
    1.99 +  hash_map() : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
   1.100 +  explicit hash_map(size_type __n)
   1.101 +    : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
   1.102 +  hash_map(size_type __n, const hasher& __hf)
   1.103 +    : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
   1.104 +  hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
   1.105 +           const allocator_type& __a = allocator_type())
   1.106 +    : _M_ht(__n, __hf, __eql, __a) {}
   1.107 +
   1.108 +  hash_map(__move_source<_Self> src)
   1.109 +    : _M_ht(__move_source<_Ht>(src.get()._M_ht)) {
   1.110 +  }
   1.111 +
   1.112 +#ifdef _STLP_MEMBER_TEMPLATES
   1.113 +  template <class _InputIterator>
   1.114 +  hash_map(_InputIterator __f, _InputIterator __l)
   1.115 +    : _M_ht(100, hasher(), key_equal(), allocator_type())
   1.116 +    { _M_ht.insert_unique(__f, __l); }
   1.117 +  template <class _InputIterator>
   1.118 +  hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
   1.119 +    : _M_ht(__n, hasher(), key_equal(), allocator_type())
   1.120 +    { _M_ht.insert_unique(__f, __l); }
   1.121 +  template <class _InputIterator>
   1.122 +  hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
   1.123 +           const hasher& __hf)
   1.124 +    : _M_ht(__n, __hf, key_equal(), allocator_type())
   1.125 +    { _M_ht.insert_unique(__f, __l); }
   1.126 +# ifdef _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS
   1.127 +  template <class _InputIterator>
   1.128 +  hash_map(_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 +  template <class _InputIterator>
   1.134 +  hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
   1.135 +           const hasher& __hf, const key_equal& __eql,
   1.136 +           const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL)
   1.137 +    : _M_ht(__n, __hf, __eql, __a)
   1.138 +    { _M_ht.insert_unique(__f, __l); }
   1.139 +
   1.140 +#else
   1.141 +  hash_map(const value_type* __f, const value_type* __l)
   1.142 +    : _M_ht(100, hasher(), key_equal(), allocator_type())
   1.143 +    { _M_ht.insert_unique(__f, __l); }
   1.144 +  hash_map(const value_type* __f, const value_type* __l, size_type __n)
   1.145 +    : _M_ht(__n, hasher(), key_equal(), allocator_type())
   1.146 +    { _M_ht.insert_unique(__f, __l); }
   1.147 +  hash_map(const value_type* __f, const value_type* __l, size_type __n,
   1.148 +           const hasher& __hf)
   1.149 +    : _M_ht(__n, __hf, key_equal(), allocator_type())
   1.150 +    { _M_ht.insert_unique(__f, __l); }
   1.151 +  hash_map(const value_type* __f, const value_type* __l, size_type __n,
   1.152 +           const hasher& __hf, const key_equal& __eql,
   1.153 +           const allocator_type& __a = allocator_type())
   1.154 +    : _M_ht(__n, __hf, __eql, __a)
   1.155 +    { _M_ht.insert_unique(__f, __l); }
   1.156 +
   1.157 +  hash_map(const_iterator __f, const_iterator __l)
   1.158 +    : _M_ht(100, hasher(), key_equal(), allocator_type())
   1.159 +    { _M_ht.insert_unique(__f, __l); }
   1.160 +  hash_map(const_iterator __f, const_iterator __l, size_type __n)
   1.161 +    : _M_ht(__n, hasher(), key_equal(), allocator_type())
   1.162 +    { _M_ht.insert_unique(__f, __l); }
   1.163 +  hash_map(const_iterator __f, const_iterator __l, size_type __n,
   1.164 +           const hasher& __hf)
   1.165 +    : _M_ht(__n, __hf, key_equal(), allocator_type())
   1.166 +    { _M_ht.insert_unique(__f, __l); }
   1.167 +  hash_map(const_iterator __f, const_iterator __l, size_type __n,
   1.168 +           const hasher& __hf, const key_equal& __eql,
   1.169 +           const allocator_type& __a = allocator_type())
   1.170 +    : _M_ht(__n, __hf, __eql, __a)
   1.171 +    { _M_ht.insert_unique(__f, __l); }
   1.172 +#endif /*_STLP_MEMBER_TEMPLATES */
   1.173 +
   1.174 +public:
   1.175 +  size_type size() const { return _M_ht.size(); }
   1.176 +  size_type max_size() const { return _M_ht.max_size(); }
   1.177 +  bool empty() const { return _M_ht.empty(); }
   1.178 +  void swap(_Self& __hs) { _M_ht.swap(__hs._M_ht); }
   1.179 +  iterator begin() { return _M_ht.begin(); }
   1.180 +  iterator end() { return _M_ht.end(); }
   1.181 +  const_iterator begin() const { return _M_ht.begin(); }
   1.182 +  const_iterator end() const { return _M_ht.end(); }
   1.183 +
   1.184 +public:
   1.185 +  pair<iterator,bool> insert(const value_type& __obj)
   1.186 +  { return _M_ht.insert_unique(__obj); }
   1.187 +#ifdef _STLP_MEMBER_TEMPLATES
   1.188 +  template <class _InputIterator>
   1.189 +  void insert(_InputIterator __f, _InputIterator __l)
   1.190 +  { _M_ht.insert_unique(__f,__l); }
   1.191 +#else
   1.192 +  void insert(const value_type* __f, const value_type* __l)
   1.193 +  { _M_ht.insert_unique(__f,__l); }
   1.194 +  void insert(const_iterator __f, const_iterator __l)
   1.195 +  { _M_ht.insert_unique(__f, __l); }
   1.196 +#endif /*_STLP_MEMBER_TEMPLATES */
   1.197 +  pair<iterator,bool> insert_noresize(const value_type& __obj)
   1.198 +  { return _M_ht.insert_unique_noresize(__obj); }
   1.199 +
   1.200 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.201 +  iterator find(const _KT& __key) { return _M_ht.find(__key); }
   1.202 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.203 +  const_iterator find(const _KT& __key) const { return _M_ht.find(__key); }
   1.204 +
   1.205 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.206 +  _Tp& operator[](const _KT& __key) {
   1.207 +    iterator __it = _M_ht.find(__key);
   1.208 +    return (__it == _M_ht.end() ?
   1.209 +      _M_ht._M_insert(value_type(__key, _STLP_DEFAULT_CONSTRUCTED(_Tp))).second :
   1.210 +      (*__it).second );
   1.211 +  }
   1.212 +
   1.213 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.214 +  size_type count(const _KT& __key) const { return _M_ht.count(__key); }
   1.215 +
   1.216 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.217 +  pair<iterator, iterator> equal_range(const _KT& __key)
   1.218 +  { return _M_ht.equal_range(__key); }
   1.219 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.220 +  pair<const_iterator, const_iterator> equal_range(const _KT& __key) const
   1.221 +  { return _M_ht.equal_range(__key); }
   1.222 +
   1.223 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.224 +  size_type erase(const _KT& __key) {return _M_ht.erase(__key); }
   1.225 +  void erase(iterator __it) { _M_ht.erase(__it); }
   1.226 +  void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
   1.227 +  void clear() { _M_ht.clear(); }
   1.228 +
   1.229 +  void resize(size_type __hint) { _M_ht.resize(__hint); }
   1.230 +  size_type bucket_count() const { return _M_ht.bucket_count(); }
   1.231 +  size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
   1.232 +  size_type elems_in_bucket(size_type __n) const
   1.233 +  { return _M_ht.elems_in_bucket(__n); }
   1.234 +};
   1.235 +
   1.236 +//Specific iterator traits creation
   1.237 +_STLP_CREATE_HASH_ITERATOR_TRAITS(HashMultimapTraitsT, traits)
   1.238 +
   1.239 +template <class _Key, class _Tp, _STLP_DFL_TMPL_PARAM(_HashFcn,hash<_Key>),
   1.240 +          _STLP_DFL_TMPL_PARAM(_EqualKey,equal_to<_Key>),
   1.241 +          _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(const _Key, _Tp) >
   1.242 +class hash_multimap
   1.243 +#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
   1.244 +                    : public __stlport_class<hash_multimap<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> >
   1.245 +#endif
   1.246 +{
   1.247 +private:
   1.248 +  typedef hash_multimap<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> _Self;
   1.249 +public:
   1.250 +  typedef _Key key_type;
   1.251 +  typedef _Tp data_type;
   1.252 +  typedef _Tp mapped_type;
   1.253 +#if !defined (__DMC__)
   1.254 +  typedef pair<const key_type, data_type> value_type;
   1.255 +#else
   1.256 +  typedef pair<key_type, data_type> value_type;
   1.257 +#endif
   1.258 +private:
   1.259 +  //Specific iterator traits creation
   1.260 +  typedef _STLP_PRIV _HashMultimapTraitsT<value_type> _HashMultimapTraits;
   1.261 +
   1.262 +public:
   1.263 +  typedef hashtable<value_type, key_type, _HashFcn, _HashMultimapTraits,
   1.264 +                    _STLP_SELECT1ST(value_type,  _Key), _EqualKey, _Alloc > _Ht;
   1.265 +
   1.266 +  typedef typename _Ht::hasher hasher;
   1.267 +  typedef typename _Ht::key_equal key_equal;
   1.268 +
   1.269 +  typedef typename _Ht::size_type size_type;
   1.270 +  typedef typename _Ht::difference_type difference_type;
   1.271 +  typedef typename _Ht::pointer pointer;
   1.272 +  typedef typename _Ht::const_pointer const_pointer;
   1.273 +  typedef typename _Ht::reference reference;
   1.274 +  typedef typename _Ht::const_reference const_reference;
   1.275 +
   1.276 +  typedef typename _Ht::iterator iterator;
   1.277 +  typedef typename _Ht::const_iterator const_iterator;
   1.278 +
   1.279 +  typedef typename _Ht::allocator_type allocator_type;
   1.280 +
   1.281 +  hasher hash_funct() const { return _M_ht.hash_funct(); }
   1.282 +  key_equal key_eq() const { return _M_ht.key_eq(); }
   1.283 +  allocator_type get_allocator() const { return _M_ht.get_allocator(); }
   1.284 +
   1.285 +private:
   1.286 +  _Ht _M_ht;
   1.287 +  _STLP_KEY_TYPE_FOR_CONT_EXT(key_type)
   1.288 +public:
   1.289 +  hash_multimap() : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
   1.290 +  explicit hash_multimap(size_type __n)
   1.291 +    : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
   1.292 +  hash_multimap(size_type __n, const hasher& __hf)
   1.293 +    : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
   1.294 +  hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
   1.295 +                const allocator_type& __a = allocator_type())
   1.296 +    : _M_ht(__n, __hf, __eql, __a) {}
   1.297 +
   1.298 +  hash_multimap(__move_source<_Self> src)
   1.299 +    : _M_ht(__move_source<_Ht>(src.get()._M_ht)) {
   1.300 +  }
   1.301 +
   1.302 +#ifdef _STLP_MEMBER_TEMPLATES
   1.303 +  template <class _InputIterator>
   1.304 +  hash_multimap(_InputIterator __f, _InputIterator __l)
   1.305 +    : _M_ht(100, hasher(), key_equal(), allocator_type())
   1.306 +    { _M_ht.insert_equal(__f, __l); }
   1.307 +  template <class _InputIterator>
   1.308 +  hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
   1.309 +    : _M_ht(__n, hasher(), key_equal(), allocator_type())
   1.310 +    { _M_ht.insert_equal(__f, __l); }
   1.311 +  template <class _InputIterator>
   1.312 +  hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
   1.313 +                const hasher& __hf)
   1.314 +    : _M_ht(__n, __hf, key_equal(), allocator_type())
   1.315 +    { _M_ht.insert_equal(__f, __l); }
   1.316 +#  ifdef _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS
   1.317 +  template <class _InputIterator>
   1.318 +  hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
   1.319 +                const hasher& __hf, const key_equal& __eql)
   1.320 +    : _M_ht(__n, __hf, __eql, allocator_type())
   1.321 +    { _M_ht.insert_equal(__f, __l); }
   1.322 +#  endif
   1.323 +  template <class _InputIterator>
   1.324 +  hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
   1.325 +                const hasher& __hf, const key_equal& __eql,
   1.326 +                const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL)
   1.327 +    : _M_ht(__n, __hf, __eql, __a)
   1.328 +    { _M_ht.insert_equal(__f, __l); }
   1.329 +
   1.330 +#else
   1.331 +  hash_multimap(const value_type* __f, const value_type* __l)
   1.332 +    : _M_ht(100, hasher(), key_equal(), allocator_type())
   1.333 +    { _M_ht.insert_equal(__f, __l); }
   1.334 +  hash_multimap(const value_type* __f, const value_type* __l, size_type __n)
   1.335 +    : _M_ht(__n, hasher(), key_equal(), allocator_type())
   1.336 +    { _M_ht.insert_equal(__f, __l); }
   1.337 +  hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
   1.338 +                const hasher& __hf)
   1.339 +    : _M_ht(__n, __hf, key_equal(), allocator_type())
   1.340 +    { _M_ht.insert_equal(__f, __l); }
   1.341 +  hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
   1.342 +                const hasher& __hf, const key_equal& __eql,
   1.343 +                const allocator_type& __a = allocator_type())
   1.344 +    : _M_ht(__n, __hf, __eql, __a)
   1.345 +    { _M_ht.insert_equal(__f, __l); }
   1.346 +
   1.347 +  hash_multimap(const_iterator __f, const_iterator __l)
   1.348 +    : _M_ht(100, hasher(), key_equal(), allocator_type())
   1.349 +    { _M_ht.insert_equal(__f, __l); }
   1.350 +  hash_multimap(const_iterator __f, const_iterator __l, size_type __n)
   1.351 +    : _M_ht(__n, hasher(), key_equal(), allocator_type())
   1.352 +    { _M_ht.insert_equal(__f, __l); }
   1.353 +  hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
   1.354 +                const hasher& __hf)
   1.355 +    : _M_ht(__n, __hf, key_equal(), allocator_type())
   1.356 +    { _M_ht.insert_equal(__f, __l); }
   1.357 +  hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
   1.358 +                const hasher& __hf, const key_equal& __eql,
   1.359 +                const allocator_type& __a = allocator_type())
   1.360 +    : _M_ht(__n, __hf, __eql, __a)
   1.361 +    { _M_ht.insert_equal(__f, __l); }
   1.362 +#endif /*_STLP_MEMBER_TEMPLATES */
   1.363 +
   1.364 +public:
   1.365 +  size_type size() const { return _M_ht.size(); }
   1.366 +  size_type max_size() const { return _M_ht.max_size(); }
   1.367 +  bool empty() const { return _M_ht.empty(); }
   1.368 +  void swap(_Self& __hs) { _M_ht.swap(__hs._M_ht); }
   1.369 +
   1.370 +  iterator begin() { return _M_ht.begin(); }
   1.371 +  iterator end() { return _M_ht.end(); }
   1.372 +  const_iterator begin() const { return _M_ht.begin(); }
   1.373 +  const_iterator end() const { return _M_ht.end(); }
   1.374 +
   1.375 +public:
   1.376 +  iterator insert(const value_type& __obj)
   1.377 +    { return _M_ht.insert_equal(__obj); }
   1.378 +#ifdef _STLP_MEMBER_TEMPLATES
   1.379 +  template <class _InputIterator>
   1.380 +  void insert(_InputIterator __f, _InputIterator __l)
   1.381 +    { _M_ht.insert_equal(__f,__l); }
   1.382 +#else
   1.383 +  void insert(const value_type* __f, const value_type* __l) {
   1.384 +    _M_ht.insert_equal(__f,__l);
   1.385 +  }
   1.386 +  void insert(const_iterator __f, const_iterator __l)
   1.387 +    { _M_ht.insert_equal(__f, __l); }
   1.388 +#endif /*_STLP_MEMBER_TEMPLATES */
   1.389 +  iterator insert_noresize(const value_type& __obj)
   1.390 +    { return _M_ht.insert_equal_noresize(__obj); }
   1.391 +
   1.392 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.393 +  iterator find(const _KT& __key) { return _M_ht.find(__key); }
   1.394 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.395 +  const_iterator find(const _KT& __key) const { return _M_ht.find(__key); }
   1.396 +
   1.397 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.398 +  size_type count(const _KT& __key) const { return _M_ht.count(__key); }
   1.399 +
   1.400 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.401 +  pair<iterator, iterator>
   1.402 +  equal_range(const _KT& __key) { return _M_ht.equal_range(__key); }
   1.403 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.404 +  pair<const_iterator, const_iterator>
   1.405 +  equal_range(const _KT& __key) const { return _M_ht.equal_range(__key); }
   1.406 +
   1.407 +  _STLP_TEMPLATE_FOR_CONT_EXT
   1.408 +  size_type erase(const _KT& __key) {return _M_ht.erase(__key); }
   1.409 +  void erase(iterator __it) { _M_ht.erase(__it); }
   1.410 +  void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
   1.411 +  void clear() { _M_ht.clear(); }
   1.412 +
   1.413 +public:
   1.414 +  void resize(size_type __hint) { _M_ht.resize(__hint); }
   1.415 +  size_type bucket_count() const { return _M_ht.bucket_count(); }
   1.416 +  size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
   1.417 +  size_type elems_in_bucket(size_type __n) const
   1.418 +  { return _M_ht.elems_in_bucket(__n); }
   1.419 +};
   1.420 +
   1.421 +#define _STLP_TEMPLATE_HEADER template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
   1.422 +#define _STLP_TEMPLATE_CONTAINER hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>
   1.423 +#include <stl/_relops_hash_cont.h>
   1.424 +#undef _STLP_TEMPLATE_CONTAINER
   1.425 +#define _STLP_TEMPLATE_CONTAINER hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>
   1.426 +#include <stl/_relops_hash_cont.h>
   1.427 +#undef _STLP_TEMPLATE_CONTAINER
   1.428 +#undef _STLP_TEMPLATE_HEADER
   1.429 +
   1.430 +#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
   1.431 +template <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
   1.432 +struct __move_traits<hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > :
   1.433 +  _STLP_PRIV __move_traits_help<typename hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>::_Ht>
   1.434 +{};
   1.435 +
   1.436 +template <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
   1.437 +struct __move_traits<hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> > :
   1.438 +  _STLP_PRIV __move_traits_help<typename hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc>::_Ht>
   1.439 +{};
   1.440 +
   1.441 +// Specialization of insert_iterator so that it will work for hash_map
   1.442 +// and hash_multimap.
   1.443 +template <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
   1.444 +class insert_iterator<hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
   1.445 +protected:
   1.446 +  typedef hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container;
   1.447 +  _Container* container;
   1.448 +public:
   1.449 +  typedef _Container          container_type;
   1.450 +  typedef output_iterator_tag iterator_category;
   1.451 +  typedef void                value_type;
   1.452 +  typedef void                difference_type;
   1.453 +  typedef void                pointer;
   1.454 +  typedef void                reference;
   1.455 +
   1.456 +  insert_iterator(_Container& __x) : container(&__x) {}
   1.457 +  insert_iterator(_Container& __x, typename _Container::iterator)
   1.458 +    : container(&__x) {}
   1.459 +  insert_iterator<_Container>&
   1.460 +  operator=(const typename _Container::value_type& __val) {
   1.461 +    container->insert(__val);
   1.462 +    return *this;
   1.463 +  }
   1.464 +  insert_iterator<_Container>& operator*() { return *this; }
   1.465 +  insert_iterator<_Container>& operator++() { return *this; }
   1.466 +  insert_iterator<_Container>& operator++(int) { return *this; }
   1.467 +};
   1.468 +
   1.469 +template <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
   1.470 +class insert_iterator<hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
   1.471 +protected:
   1.472 +  typedef hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container;
   1.473 +  _Container* container;
   1.474 +  typename _Container::iterator iter;
   1.475 +public:
   1.476 +  typedef _Container          container_type;
   1.477 +  typedef output_iterator_tag iterator_category;
   1.478 +  typedef void                value_type;
   1.479 +  typedef void                difference_type;
   1.480 +  typedef void                pointer;
   1.481 +  typedef void                reference;
   1.482 +
   1.483 +  insert_iterator(_Container& __x) : container(&__x) {}
   1.484 +  insert_iterator(_Container& __x, typename _Container::iterator)
   1.485 +    : container(&__x) {}
   1.486 +  insert_iterator<_Container>&
   1.487 +  operator=(const typename _Container::value_type& __val) {
   1.488 +    container->insert(__val);
   1.489 +    return *this;
   1.490 +  }
   1.491 +  insert_iterator<_Container>& operator*() { return *this; }
   1.492 +  insert_iterator<_Container>& operator++() { return *this; }
   1.493 +  insert_iterator<_Container>& operator++(int) { return *this; }
   1.494 +};
   1.495 +#endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */
   1.496 +
   1.497 +_STLP_END_NAMESPACE
   1.498 +
   1.499 +#endif /* _STLP_INTERNAL_HASH_MAP_H */
   1.500 +
   1.501 +// Local Variables:
   1.502 +// mode:C++
   1.503 +// End: