_hash_map.h revision e46c9386c4f79aa40185f79a19fc5b2a7ef528b3
19720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/*
29720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
39720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1994
49720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Hewlett-Packard Company
59720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
69720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1996,1997
79720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Silicon Graphics Computer Systems, Inc.
89720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
99720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1997
109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Moscow Center for SPARC Technology
119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1999
139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Boris Fomitchev
149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * This material is provided "as is", with absolutely no warranty expressed
169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * or implied. Any use is at your own risk.
179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Permission to use or copy this software for any purpose is hereby granted
199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * without fee, provided the above notices are retained on all copies.
209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Permission to modify the code and to distribute modified code is granted,
219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * provided the above notices are retained, and a notice that the code was
229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * modified is included with the above copyright notice.
239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */
259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* NOTE: This is an internal header file, included by other STL headers.
279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *   You should not attempt to use it directly.
289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */
299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_HASH_MAP_H
319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define _STLP_INTERNAL_HASH_MAP_H
329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_HASHTABLE_H
349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  include <stl/_hashtable.h>
359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_BEGIN_NAMESPACE
389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block//Specific iterator traits creation
409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_CREATE_HASH_ITERATOR_TRAITS(HashMapTraitsT, traits)
419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Key, class _Tp, _STLP_DFL_TMPL_PARAM(_HashFcn,hash<_Key>),
439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block          _STLP_DFL_TMPL_PARAM(_EqualKey,equal_to<_Key>),
44e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott          _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(_STLP_CONST _Key, _Tp) >
459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass hash_map
469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block               : public __stlport_class<hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> >
489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{
509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> _Self;
529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Key key_type;
549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp data_type;
559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp mapped_type;
56e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  typedef pair<_STLP_CONST key_type, data_type> value_type;
579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  //Specific iterator traits creation
599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _STLP_PRIV _HashMapTraitsT<value_type> _HashMapTraits;
609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef hashtable<value_type, key_type, _HashFcn, _HashMapTraits,
639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                    _STLP_SELECT1ST(value_type, _Key), _EqualKey, _Alloc > _Ht;
649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::hasher hasher;
669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::key_equal key_equal;
679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::size_type size_type;
699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::difference_type difference_type;
709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::pointer pointer;
719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::const_pointer const_pointer;
729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::reference reference;
739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::const_reference const_reference;
749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::iterator iterator;
769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::const_iterator const_iterator;
779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::allocator_type allocator_type;
799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hasher hash_funct() const { return _M_ht.hash_funct(); }
819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  key_equal key_eq() const { return _M_ht.key_eq(); }
829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  allocator_type get_allocator() const { return _M_ht.get_allocator(); }
839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Ht _M_ht;
869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_KEY_TYPE_FOR_CONT_EXT(key_type)
879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
88e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  hash_map() : _M_ht(0, hasher(), key_equal(), allocator_type()) {}
899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  explicit hash_map(size_type __n)
909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(size_type __n, const hasher& __hf)
929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block           const allocator_type& __a = allocator_type())
959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, __eql, __a) {}
969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
97e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if !defined (_STLP_NO_MOVE_SEMANTIC)
989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(__move_source<_Self> src)
999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__move_source<_Ht>(src.get()._M_ht)) {
1009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
101e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
1029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifdef _STLP_MEMBER_TEMPLATES
1049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
1059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(_InputIterator __f, _InputIterator __l)
106e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott    : _M_ht(0, hasher(), key_equal(), allocator_type())
1079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
1099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
1109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, hasher(), key_equal(), allocator_type())
1119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
1139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
1149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block           const hasher& __hf)
1159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, key_equal(), allocator_type())
1169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block# ifdef _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS
1189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
1199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
1209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block           const hasher& __hf, const key_equal& __eql)
1219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, __eql, allocator_type())
1229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block# endif
1249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
1259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
1269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block           const hasher& __hf, const key_equal& __eql,
1279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block           const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL)
1289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, __eql, __a)
1299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
1329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(const value_type* __f, const value_type* __l)
133e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott    : _M_ht(0, hasher(), key_equal(), allocator_type())
1349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(const value_type* __f, const value_type* __l, size_type __n)
1369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, hasher(), key_equal(), allocator_type())
1379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(const value_type* __f, const value_type* __l, size_type __n,
1399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block           const hasher& __hf)
1409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, key_equal(), allocator_type())
1419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(const value_type* __f, const value_type* __l, size_type __n,
1439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block           const hasher& __hf, const key_equal& __eql,
1449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block           const allocator_type& __a = allocator_type())
1459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, __eql, __a)
1469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(const_iterator __f, const_iterator __l)
149e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott    : _M_ht(0, hasher(), key_equal(), allocator_type())
1509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(const_iterator __f, const_iterator __l, size_type __n)
1529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, hasher(), key_equal(), allocator_type())
1539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(const_iterator __f, const_iterator __l, size_type __n,
1559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block           const hasher& __hf)
1569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, key_equal(), allocator_type())
1579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_map(const_iterator __f, const_iterator __l, size_type __n,
1599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block           const hasher& __hf, const key_equal& __eql,
1609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block           const allocator_type& __a = allocator_type())
1619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, __eql, __a)
1629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_unique(__f, __l); }
1639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /*_STLP_MEMBER_TEMPLATES */
1649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
1669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type size() const { return _M_ht.size(); }
1679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type max_size() const { return _M_ht.max_size(); }
1689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  bool empty() const { return _M_ht.empty(); }
1699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void swap(_Self& __hs) { _M_ht.swap(__hs._M_ht); }
170e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
171e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  void _M_swap_workaround(_Self& __x) { swap(__x); }
172e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
1739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator begin() { return _M_ht.begin(); }
1749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator end() { return _M_ht.end(); }
1759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_iterator begin() const { return _M_ht.begin(); }
1769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_iterator end() const { return _M_ht.end(); }
1779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
1799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  pair<iterator,bool> insert(const value_type& __obj)
1809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return _M_ht.insert_unique(__obj); }
1819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifdef _STLP_MEMBER_TEMPLATES
1829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
1839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void insert(_InputIterator __f, _InputIterator __l)
1849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { _M_ht.insert_unique(__f,__l); }
1859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
1869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void insert(const value_type* __f, const value_type* __l)
1879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { _M_ht.insert_unique(__f,__l); }
1889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void insert(const_iterator __f, const_iterator __l)
1899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { _M_ht.insert_unique(__f, __l); }
1909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /*_STLP_MEMBER_TEMPLATES */
1919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  pair<iterator,bool> insert_noresize(const value_type& __obj)
1929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return _M_ht.insert_unique_noresize(__obj); }
1939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
1959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator find(const _KT& __key) { return _M_ht.find(__key); }
1969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
1979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_iterator find(const _KT& __key) const { return _M_ht.find(__key); }
1989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
2009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Tp& operator[](const _KT& __key) {
2019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    iterator __it = _M_ht.find(__key);
2029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    return (__it == _M_ht.end() ?
2039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      _M_ht._M_insert(value_type(__key, _STLP_DEFAULT_CONSTRUCTED(_Tp))).second :
2049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      (*__it).second );
2059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
2069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
2089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type count(const _KT& __key) const { return _M_ht.count(__key); }
2099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
2119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  pair<iterator, iterator> equal_range(const _KT& __key)
2129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return _M_ht.equal_range(__key); }
2139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
2149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  pair<const_iterator, const_iterator> equal_range(const _KT& __key) const
2159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return _M_ht.equal_range(__key); }
2169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
2189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type erase(const _KT& __key) {return _M_ht.erase(__key); }
2199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void erase(iterator __it) { _M_ht.erase(__it); }
2209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
2219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void clear() { _M_ht.clear(); }
2229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void resize(size_type __hint) { _M_ht.resize(__hint); }
2249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type bucket_count() const { return _M_ht.bucket_count(); }
2259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
2269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type elems_in_bucket(size_type __n) const
2279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return _M_ht.elems_in_bucket(__n); }
2289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
2299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block//Specific iterator traits creation
2319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_CREATE_HASH_ITERATOR_TRAITS(HashMultimapTraitsT, traits)
2329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Key, class _Tp, _STLP_DFL_TMPL_PARAM(_HashFcn,hash<_Key>),
2349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block          _STLP_DFL_TMPL_PARAM(_EqualKey,equal_to<_Key>),
235e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott          _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(_STLP_CONST _Key, _Tp) >
2369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass hash_multimap
2379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
2389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                    : public __stlport_class<hash_multimap<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> >
2399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
2409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{
2419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
2429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef hash_multimap<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> _Self;
2439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
2449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Key key_type;
2459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp data_type;
2469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp mapped_type;
247e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  typedef pair<_STLP_CONST key_type, data_type> value_type;
2489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
2499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  //Specific iterator traits creation
2509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _STLP_PRIV _HashMultimapTraitsT<value_type> _HashMultimapTraits;
2519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
2539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef hashtable<value_type, key_type, _HashFcn, _HashMultimapTraits,
2549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                    _STLP_SELECT1ST(value_type,  _Key), _EqualKey, _Alloc > _Ht;
2559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::hasher hasher;
2579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::key_equal key_equal;
2589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::size_type size_type;
2609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::difference_type difference_type;
2619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::pointer pointer;
2629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::const_pointer const_pointer;
2639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::reference reference;
2649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::const_reference const_reference;
2659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::iterator iterator;
2679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::const_iterator const_iterator;
2689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Ht::allocator_type allocator_type;
2709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hasher hash_funct() const { return _M_ht.hash_funct(); }
2729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  key_equal key_eq() const { return _M_ht.key_eq(); }
2739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  allocator_type get_allocator() const { return _M_ht.get_allocator(); }
2749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
2769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Ht _M_ht;
2779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_KEY_TYPE_FOR_CONT_EXT(key_type)
2789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
279e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  hash_multimap() : _M_ht(0, hasher(), key_equal(), allocator_type()) {}
2809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  explicit hash_multimap(size_type __n)
2819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
2829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(size_type __n, const hasher& __hf)
2839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
2849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
2859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                const allocator_type& __a = allocator_type())
2869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, __eql, __a) {}
2879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
288e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if !defined (_STLP_NO_MOVE_SEMANTIC)
2899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(__move_source<_Self> src)
2909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__move_source<_Ht>(src.get()._M_ht)) {
2919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
292e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
2939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifdef _STLP_MEMBER_TEMPLATES
2959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
2969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(_InputIterator __f, _InputIterator __l)
297e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott    : _M_ht(0, hasher(), key_equal(), allocator_type())
2989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
2999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
3009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
3019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, hasher(), key_equal(), allocator_type())
3029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
3049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
3059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                const hasher& __hf)
3069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, key_equal(), allocator_type())
3079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  ifdef _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS
3099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
3109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
3119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                const hasher& __hf, const key_equal& __eql)
3129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, __eql, allocator_type())
3139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
3159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
3169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
3179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                const hasher& __hf, const key_equal& __eql,
3189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL)
3199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, __eql, __a)
3209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
3239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(const value_type* __f, const value_type* __l)
324e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott    : _M_ht(0, hasher(), key_equal(), allocator_type())
3259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(const value_type* __f, const value_type* __l, size_type __n)
3279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, hasher(), key_equal(), allocator_type())
3289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
3309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                const hasher& __hf)
3319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, key_equal(), allocator_type())
3329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
3349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                const hasher& __hf, const key_equal& __eql,
3359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                const allocator_type& __a = allocator_type())
3369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, __eql, __a)
3379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(const_iterator __f, const_iterator __l)
340e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott    : _M_ht(0, hasher(), key_equal(), allocator_type())
3419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(const_iterator __f, const_iterator __l, size_type __n)
3439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, hasher(), key_equal(), allocator_type())
3449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
3469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                const hasher& __hf)
3479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, key_equal(), allocator_type())
3489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
3509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                const hasher& __hf, const key_equal& __eql,
3519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                const allocator_type& __a = allocator_type())
3529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_ht(__n, __hf, __eql, __a)
3539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /*_STLP_MEMBER_TEMPLATES */
3559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
3579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type size() const { return _M_ht.size(); }
3589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type max_size() const { return _M_ht.max_size(); }
3599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  bool empty() const { return _M_ht.empty(); }
3609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void swap(_Self& __hs) { _M_ht.swap(__hs._M_ht); }
361e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
362e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  void _M_swap_workaround(_Self& __x) { swap(__x); }
363e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
3649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator begin() { return _M_ht.begin(); }
3669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator end() { return _M_ht.end(); }
3679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_iterator begin() const { return _M_ht.begin(); }
3689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_iterator end() const { return _M_ht.end(); }
3699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
3719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator insert(const value_type& __obj)
3729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { return _M_ht.insert_equal(__obj); }
3739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifdef _STLP_MEMBER_TEMPLATES
3749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
3759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void insert(_InputIterator __f, _InputIterator __l)
3769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f,__l); }
3779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
3789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void insert(const value_type* __f, const value_type* __l) {
3799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _M_ht.insert_equal(__f,__l);
3809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
3819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void insert(const_iterator __f, const_iterator __l)
3829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { _M_ht.insert_equal(__f, __l); }
3839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /*_STLP_MEMBER_TEMPLATES */
3849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator insert_noresize(const value_type& __obj)
3859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    { return _M_ht.insert_equal_noresize(__obj); }
3869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
3889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator find(const _KT& __key) { return _M_ht.find(__key); }
3899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
3909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_iterator find(const _KT& __key) const { return _M_ht.find(__key); }
3919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
3939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type count(const _KT& __key) const { return _M_ht.count(__key); }
3949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
3969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  pair<iterator, iterator>
3979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  equal_range(const _KT& __key) { return _M_ht.equal_range(__key); }
3989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
3999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  pair<const_iterator, const_iterator>
4009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  equal_range(const _KT& __key) const { return _M_ht.equal_range(__key); }
4019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_TEMPLATE_FOR_CONT_EXT
4039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type erase(const _KT& __key) {return _M_ht.erase(__key); }
4049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void erase(iterator __it) { _M_ht.erase(__it); }
4059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
4069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void clear() { _M_ht.clear(); }
4079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
4099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void resize(size_type __hint) { _M_ht.resize(__hint); }
4109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type bucket_count() const { return _M_ht.bucket_count(); }
4119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
4129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type elems_in_bucket(size_type __n) const
4139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return _M_ht.elems_in_bucket(__n); }
4149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
4159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define _STLP_TEMPLATE_HEADER template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
4179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define _STLP_TEMPLATE_CONTAINER hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>
4189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#include <stl/_relops_hash_cont.h>
4199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#undef _STLP_TEMPLATE_CONTAINER
4209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define _STLP_TEMPLATE_CONTAINER hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>
4219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#include <stl/_relops_hash_cont.h>
4229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#undef _STLP_TEMPLATE_CONTAINER
4239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#undef _STLP_TEMPLATE_HEADER
4249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
426e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#  if !defined (_STLP_NO_MOVE_SEMANTIC)
4279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
4289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct __move_traits<hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > :
4299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_PRIV __move_traits_help<typename hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>::_Ht>
4309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{};
4319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
4339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct __move_traits<hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> > :
4349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_PRIV __move_traits_help<typename hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc>::_Ht>
4359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{};
436e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#  endif
4379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Specialization of insert_iterator so that it will work for hash_map
4399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// and hash_multimap.
4409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
4419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass insert_iterator<hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
4429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprotected:
4439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container;
4449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Container* container;
4459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
4469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Container          container_type;
4479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef output_iterator_tag iterator_category;
4489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef void                value_type;
4499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef void                difference_type;
4509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef void                pointer;
4519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef void                reference;
4529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator(_Container& __x) : container(&__x) {}
4549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator(_Container& __x, typename _Container::iterator)
4559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : container(&__x) {}
4569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator<_Container>&
4579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  operator=(const typename _Container::value_type& __val) {
4589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    container->insert(__val);
4599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    return *this;
4609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
4619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator<_Container>& operator*() { return *this; }
4629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator<_Container>& operator++() { return *this; }
4639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator<_Container>& operator++(int) { return *this; }
4649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
4659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
4679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass insert_iterator<hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
4689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprotected:
4699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container;
4709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Container* container;
4719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typename _Container::iterator iter;
4729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
4739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Container          container_type;
4749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef output_iterator_tag iterator_category;
4759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef void                value_type;
4769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef void                difference_type;
4779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef void                pointer;
4789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef void                reference;
4799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator(_Container& __x) : container(&__x) {}
4819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator(_Container& __x, typename _Container::iterator)
4829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : container(&__x) {}
4839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator<_Container>&
4849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  operator=(const typename _Container::value_type& __val) {
4859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    container->insert(__val);
4869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    return *this;
4879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
4889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator<_Container>& operator*() { return *this; }
4899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator<_Container>& operator++() { return *this; }
4909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  insert_iterator<_Container>& operator++(int) { return *this; }
4919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
4929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */
4939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_END_NAMESPACE
4959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_INTERNAL_HASH_MAP_H */
4979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
4989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Local Variables:
4999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// mode:C++
5009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// End:
501