ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

_hash_map.h
Go to the documentation of this file.
00001 /*
00002  *
00003  * Copyright (c) 1994
00004  * Hewlett-Packard Company
00005  *
00006  * Copyright (c) 1996,1997
00007  * Silicon Graphics Computer Systems, Inc.
00008  *
00009  * Copyright (c) 1997
00010  * Moscow Center for SPARC Technology
00011  *
00012  * Copyright (c) 1999
00013  * Boris Fomitchev
00014  *
00015  * This material is provided "as is", with absolutely no warranty expressed
00016  * or implied. Any use is at your own risk.
00017  *
00018  * Permission to use or copy this software for any purpose is hereby granted
00019  * without fee, provided the above notices are retained on all copies.
00020  * Permission to modify the code and to distribute modified code is granted,
00021  * provided the above notices are retained, and a notice that the code was
00022  * modified is included with the above copyright notice.
00023  *
00024  */
00025 
00026 /* NOTE: This is an internal header file, included by other STL headers.
00027  *   You should not attempt to use it directly.
00028  */
00029 
00030 #ifndef _STLP_INTERNAL_HASH_MAP_H
00031 #define _STLP_INTERNAL_HASH_MAP_H
00032 
00033 #ifndef _STLP_INTERNAL_HASHTABLE_H
00034 #  include <stl/_hashtable.h>
00035 #endif
00036 
00037 _STLP_BEGIN_NAMESPACE
00038 
00039 //Specific iterator traits creation
00040 _STLP_CREATE_HASH_ITERATOR_TRAITS(HashMapTraitsT, traits)
00041 
00042 template <class _Key, class _Tp, _STLP_DFL_TMPL_PARAM(_HashFcn,hash<_Key>),
00043           _STLP_DFL_TMPL_PARAM(_EqualKey,equal_to<_Key>),
00044           _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(_STLP_CONST _Key, _Tp) >
00045 class hash_map
00046 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
00047                : public __stlport_class<hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> >
00048 #endif
00049 {
00050 private:
00051   typedef hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> _Self;
00052 public:
00053   typedef _Key key_type;
00054   typedef _Tp data_type;
00055   typedef _Tp mapped_type;
00056   typedef pair<_STLP_CONST key_type, data_type> value_type;
00057 private:
00058   //Specific iterator traits creation
00059   typedef _STLP_PRIV _HashMapTraitsT<value_type> _HashMapTraits;
00060 
00061 public:
00062   typedef hashtable<value_type, key_type, _HashFcn, _HashMapTraits,
00063                     _STLP_SELECT1ST(value_type, _Key), _EqualKey, _Alloc > _Ht;
00064 
00065   typedef typename _Ht::hasher hasher;
00066   typedef typename _Ht::key_equal key_equal;
00067 
00068   typedef typename _Ht::size_type size_type;
00069   typedef typename _Ht::difference_type difference_type;
00070   typedef typename _Ht::pointer pointer;
00071   typedef typename _Ht::const_pointer const_pointer;
00072   typedef typename _Ht::reference reference;
00073   typedef typename _Ht::const_reference const_reference;
00074 
00075   typedef typename _Ht::iterator iterator;
00076   typedef typename _Ht::const_iterator const_iterator;
00077 
00078   typedef typename _Ht::allocator_type allocator_type;
00079 
00080   hasher hash_funct() const { return _M_ht.hash_funct(); }
00081   key_equal key_eq() const { return _M_ht.key_eq(); }
00082   allocator_type get_allocator() const { return _M_ht.get_allocator(); }
00083 
00084 private:
00085   _Ht _M_ht;
00086   _STLP_KEY_TYPE_FOR_CONT_EXT(key_type)
00087 public:
00088   hash_map() : _M_ht(0, hasher(), key_equal(), allocator_type()) {}
00089   explicit hash_map(size_type __n)
00090     : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
00091   hash_map(size_type __n, const hasher& __hf)
00092     : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
00093   hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
00094            const allocator_type& __a = allocator_type())
00095     : _M_ht(__n, __hf, __eql, __a) {}
00096 
00097 #if !defined (_STLP_NO_MOVE_SEMANTIC)
00098   hash_map(__move_source<_Self> src)
00099     : _M_ht(__move_source<_Ht>(src.get()._M_ht)) {
00100   }
00101 #endif
00102 
00103 #ifdef _STLP_MEMBER_TEMPLATES
00104   template <class _InputIterator>
00105   hash_map(_InputIterator __f, _InputIterator __l)
00106     : _M_ht(0, hasher(), key_equal(), allocator_type())
00107     { _M_ht.insert_unique(__f, __l); }
00108   template <class _InputIterator>
00109   hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
00110     : _M_ht(__n, hasher(), key_equal(), allocator_type())
00111     { _M_ht.insert_unique(__f, __l); }
00112   template <class _InputIterator>
00113   hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
00114            const hasher& __hf)
00115     : _M_ht(__n, __hf, key_equal(), allocator_type())
00116     { _M_ht.insert_unique(__f, __l); }
00117 # ifdef _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS
00118   template <class _InputIterator>
00119   hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
00120            const hasher& __hf, const key_equal& __eql)
00121     : _M_ht(__n, __hf, __eql, allocator_type())
00122     { _M_ht.insert_unique(__f, __l); }
00123 # endif
00124   template <class _InputIterator>
00125   hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
00126            const hasher& __hf, const key_equal& __eql,
00127            const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL)
00128     : _M_ht(__n, __hf, __eql, __a)
00129     { _M_ht.insert_unique(__f, __l); }
00130 
00131 #else
00132   hash_map(const value_type* __f, const value_type* __l)
00133     : _M_ht(0, hasher(), key_equal(), allocator_type())
00134     { _M_ht.insert_unique(__f, __l); }
00135   hash_map(const value_type* __f, const value_type* __l, size_type __n)
00136     : _M_ht(__n, hasher(), key_equal(), allocator_type())
00137     { _M_ht.insert_unique(__f, __l); }
00138   hash_map(const value_type* __f, const value_type* __l, size_type __n,
00139            const hasher& __hf)
00140     : _M_ht(__n, __hf, key_equal(), allocator_type())
00141     { _M_ht.insert_unique(__f, __l); }
00142   hash_map(const value_type* __f, const value_type* __l, size_type __n,
00143            const hasher& __hf, const key_equal& __eql,
00144            const allocator_type& __a = allocator_type())
00145     : _M_ht(__n, __hf, __eql, __a)
00146     { _M_ht.insert_unique(__f, __l); }
00147 
00148   hash_map(const_iterator __f, const_iterator __l)
00149     : _M_ht(0, hasher(), key_equal(), allocator_type())
00150     { _M_ht.insert_unique(__f, __l); }
00151   hash_map(const_iterator __f, const_iterator __l, size_type __n)
00152     : _M_ht(__n, hasher(), key_equal(), allocator_type())
00153     { _M_ht.insert_unique(__f, __l); }
00154   hash_map(const_iterator __f, const_iterator __l, size_type __n,
00155            const hasher& __hf)
00156     : _M_ht(__n, __hf, key_equal(), allocator_type())
00157     { _M_ht.insert_unique(__f, __l); }
00158   hash_map(const_iterator __f, const_iterator __l, size_type __n,
00159            const hasher& __hf, const key_equal& __eql,
00160            const allocator_type& __a = allocator_type())
00161     : _M_ht(__n, __hf, __eql, __a)
00162     { _M_ht.insert_unique(__f, __l); }
00163 #endif /*_STLP_MEMBER_TEMPLATES */
00164 
00165 public:
00166   size_type size() const { return _M_ht.size(); }
00167   size_type max_size() const { return _M_ht.max_size(); }
00168   bool empty() const { return _M_ht.empty(); }
00169   void swap(_Self& __hs) { _M_ht.swap(__hs._M_ht); }
00170 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
00171   void _M_swap_workaround(_Self& __x) { swap(__x); }
00172 #endif
00173   iterator begin() { return _M_ht.begin(); }
00174   iterator end() { return _M_ht.end(); }
00175   const_iterator begin() const { return _M_ht.begin(); }
00176   const_iterator end() const { return _M_ht.end(); }
00177 
00178 public:
00179   pair<iterator,bool> insert(const value_type& __obj)
00180   { return _M_ht.insert_unique(__obj); }
00181 #ifdef _STLP_MEMBER_TEMPLATES
00182   template <class _InputIterator>
00183   void insert(_InputIterator __f, _InputIterator __l)
00184   { _M_ht.insert_unique(__f,__l); }
00185 #else
00186   void insert(const value_type* __f, const value_type* __l)
00187   { _M_ht.insert_unique(__f,__l); }
00188   void insert(const_iterator __f, const_iterator __l)
00189   { _M_ht.insert_unique(__f, __l); }
00190 #endif /*_STLP_MEMBER_TEMPLATES */
00191   pair<iterator,bool> insert_noresize(const value_type& __obj)
00192   { return _M_ht.insert_unique_noresize(__obj); }
00193 
00194   _STLP_TEMPLATE_FOR_CONT_EXT
00195   iterator find(const _KT& __key) { return _M_ht.find(__key); }
00196   _STLP_TEMPLATE_FOR_CONT_EXT
00197   const_iterator find(const _KT& __key) const { return _M_ht.find(__key); }
00198 
00199   _STLP_TEMPLATE_FOR_CONT_EXT
00200   _Tp& operator[](const _KT& __key) {
00201     iterator __it = _M_ht.find(__key);
00202     return (__it == _M_ht.end() ?
00203       _M_ht._M_insert(value_type(__key, _STLP_DEFAULT_CONSTRUCTED(_Tp))).second :
00204       (*__it).second );
00205   }
00206 
00207   _STLP_TEMPLATE_FOR_CONT_EXT
00208   size_type count(const _KT& __key) const { return _M_ht.count(__key); }
00209 
00210   _STLP_TEMPLATE_FOR_CONT_EXT
00211   pair<iterator, iterator> equal_range(const _KT& __key)
00212   { return _M_ht.equal_range(__key); }
00213   _STLP_TEMPLATE_FOR_CONT_EXT
00214   pair<const_iterator, const_iterator> equal_range(const _KT& __key) const
00215   { return _M_ht.equal_range(__key); }
00216 
00217   _STLP_TEMPLATE_FOR_CONT_EXT
00218   size_type erase(const _KT& __key) {return _M_ht.erase(__key); }
00219   void erase(iterator __it) { _M_ht.erase(__it); }
00220   void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
00221   void clear() { _M_ht.clear(); }
00222 
00223   void resize(size_type __hint) { _M_ht.resize(__hint); }
00224   size_type bucket_count() const { return _M_ht.bucket_count(); }
00225   size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
00226   size_type elems_in_bucket(size_type __n) const
00227   { return _M_ht.elems_in_bucket(__n); }
00228 };
00229 
00230 //Specific iterator traits creation
00231 _STLP_CREATE_HASH_ITERATOR_TRAITS(HashMultimapTraitsT, traits)
00232 
00233 template <class _Key, class _Tp, _STLP_DFL_TMPL_PARAM(_HashFcn,hash<_Key>),
00234           _STLP_DFL_TMPL_PARAM(_EqualKey,equal_to<_Key>),
00235           _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(_STLP_CONST _Key, _Tp) >
00236 class hash_multimap
00237 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
00238                     : public __stlport_class<hash_multimap<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> >
00239 #endif
00240 {
00241 private:
00242   typedef hash_multimap<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> _Self;
00243 public:
00244   typedef _Key key_type;
00245   typedef _Tp data_type;
00246   typedef _Tp mapped_type;
00247   typedef pair<_STLP_CONST key_type, data_type> value_type;
00248 private:
00249   //Specific iterator traits creation
00250   typedef _STLP_PRIV _HashMultimapTraitsT<value_type> _HashMultimapTraits;
00251 
00252 public:
00253   typedef hashtable<value_type, key_type, _HashFcn, _HashMultimapTraits,
00254                     _STLP_SELECT1ST(value_type,  _Key), _EqualKey, _Alloc > _Ht;
00255 
00256   typedef typename _Ht::hasher hasher;
00257   typedef typename _Ht::key_equal key_equal;
00258 
00259   typedef typename _Ht::size_type size_type;
00260   typedef typename _Ht::difference_type difference_type;
00261   typedef typename _Ht::pointer pointer;
00262   typedef typename _Ht::const_pointer const_pointer;
00263   typedef typename _Ht::reference reference;
00264   typedef typename _Ht::const_reference const_reference;
00265 
00266   typedef typename _Ht::iterator iterator;
00267   typedef typename _Ht::const_iterator const_iterator;
00268 
00269   typedef typename _Ht::allocator_type allocator_type;
00270 
00271   hasher hash_funct() const { return _M_ht.hash_funct(); }
00272   key_equal key_eq() const { return _M_ht.key_eq(); }
00273   allocator_type get_allocator() const { return _M_ht.get_allocator(); }
00274 
00275 private:
00276   _Ht _M_ht;
00277   _STLP_KEY_TYPE_FOR_CONT_EXT(key_type)
00278 public:
00279   hash_multimap() : _M_ht(0, hasher(), key_equal(), allocator_type()) {}
00280   explicit hash_multimap(size_type __n)
00281     : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
00282   hash_multimap(size_type __n, const hasher& __hf)
00283     : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
00284   hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
00285                 const allocator_type& __a = allocator_type())
00286     : _M_ht(__n, __hf, __eql, __a) {}
00287 
00288 #if !defined (_STLP_NO_MOVE_SEMANTIC)
00289   hash_multimap(__move_source<_Self> src)
00290     : _M_ht(__move_source<_Ht>(src.get()._M_ht)) {
00291   }
00292 #endif
00293 
00294 #ifdef _STLP_MEMBER_TEMPLATES
00295   template <class _InputIterator>
00296   hash_multimap(_InputIterator __f, _InputIterator __l)
00297     : _M_ht(0, hasher(), key_equal(), allocator_type())
00298     { _M_ht.insert_equal(__f, __l); }
00299   template <class _InputIterator>
00300   hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
00301     : _M_ht(__n, hasher(), key_equal(), allocator_type())
00302     { _M_ht.insert_equal(__f, __l); }
00303   template <class _InputIterator>
00304   hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
00305                 const hasher& __hf)
00306     : _M_ht(__n, __hf, key_equal(), allocator_type())
00307     { _M_ht.insert_equal(__f, __l); }
00308 #  ifdef _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS
00309   template <class _InputIterator>
00310   hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
00311                 const hasher& __hf, const key_equal& __eql)
00312     : _M_ht(__n, __hf, __eql, allocator_type())
00313     { _M_ht.insert_equal(__f, __l); }
00314 #  endif
00315   template <class _InputIterator>
00316   hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
00317                 const hasher& __hf, const key_equal& __eql,
00318                 const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL)
00319     : _M_ht(__n, __hf, __eql, __a)
00320     { _M_ht.insert_equal(__f, __l); }
00321 
00322 #else
00323   hash_multimap(const value_type* __f, const value_type* __l)
00324     : _M_ht(0, hasher(), key_equal(), allocator_type())
00325     { _M_ht.insert_equal(__f, __l); }
00326   hash_multimap(const value_type* __f, const value_type* __l, size_type __n)
00327     : _M_ht(__n, hasher(), key_equal(), allocator_type())
00328     { _M_ht.insert_equal(__f, __l); }
00329   hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
00330                 const hasher& __hf)
00331     : _M_ht(__n, __hf, key_equal(), allocator_type())
00332     { _M_ht.insert_equal(__f, __l); }
00333   hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
00334                 const hasher& __hf, const key_equal& __eql,
00335                 const allocator_type& __a = allocator_type())
00336     : _M_ht(__n, __hf, __eql, __a)
00337     { _M_ht.insert_equal(__f, __l); }
00338 
00339   hash_multimap(const_iterator __f, const_iterator __l)
00340     : _M_ht(0, hasher(), key_equal(), allocator_type())
00341     { _M_ht.insert_equal(__f, __l); }
00342   hash_multimap(const_iterator __f, const_iterator __l, size_type __n)
00343     : _M_ht(__n, hasher(), key_equal(), allocator_type())
00344     { _M_ht.insert_equal(__f, __l); }
00345   hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
00346                 const hasher& __hf)
00347     : _M_ht(__n, __hf, key_equal(), allocator_type())
00348     { _M_ht.insert_equal(__f, __l); }
00349   hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
00350                 const hasher& __hf, const key_equal& __eql,
00351                 const allocator_type& __a = allocator_type())
00352     : _M_ht(__n, __hf, __eql, __a)
00353     { _M_ht.insert_equal(__f, __l); }
00354 #endif /*_STLP_MEMBER_TEMPLATES */
00355 
00356 public:
00357   size_type size() const { return _M_ht.size(); }
00358   size_type max_size() const { return _M_ht.max_size(); }
00359   bool empty() const { return _M_ht.empty(); }
00360   void swap(_Self& __hs) { _M_ht.swap(__hs._M_ht); }
00361 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
00362   void _M_swap_workaround(_Self& __x) { swap(__x); }
00363 #endif
00364 
00365   iterator begin() { return _M_ht.begin(); }
00366   iterator end() { return _M_ht.end(); }
00367   const_iterator begin() const { return _M_ht.begin(); }
00368   const_iterator end() const { return _M_ht.end(); }
00369 
00370 public:
00371   iterator insert(const value_type& __obj)
00372     { return _M_ht.insert_equal(__obj); }
00373 #ifdef _STLP_MEMBER_TEMPLATES
00374   template <class _InputIterator>
00375   void insert(_InputIterator __f, _InputIterator __l)
00376     { _M_ht.insert_equal(__f,__l); }
00377 #else
00378   void insert(const value_type* __f, const value_type* __l) {
00379     _M_ht.insert_equal(__f,__l);
00380   }
00381   void insert(const_iterator __f, const_iterator __l)
00382     { _M_ht.insert_equal(__f, __l); }
00383 #endif /*_STLP_MEMBER_TEMPLATES */
00384   iterator insert_noresize(const value_type& __obj)
00385     { return _M_ht.insert_equal_noresize(__obj); }
00386 
00387   _STLP_TEMPLATE_FOR_CONT_EXT
00388   iterator find(const _KT& __key) { return _M_ht.find(__key); }
00389   _STLP_TEMPLATE_FOR_CONT_EXT
00390   const_iterator find(const _KT& __key) const { return _M_ht.find(__key); }
00391 
00392   _STLP_TEMPLATE_FOR_CONT_EXT
00393   size_type count(const _KT& __key) const { return _M_ht.count(__key); }
00394 
00395   _STLP_TEMPLATE_FOR_CONT_EXT
00396   pair<iterator, iterator>
00397   equal_range(const _KT& __key) { return _M_ht.equal_range(__key); }
00398   _STLP_TEMPLATE_FOR_CONT_EXT
00399   pair<const_iterator, const_iterator>
00400   equal_range(const _KT& __key) const { return _M_ht.equal_range(__key); }
00401 
00402   _STLP_TEMPLATE_FOR_CONT_EXT
00403   size_type erase(const _KT& __key) {return _M_ht.erase(__key); }
00404   void erase(iterator __it) { _M_ht.erase(__it); }
00405   void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
00406   void clear() { _M_ht.clear(); }
00407 
00408 public:
00409   void resize(size_type __hint) { _M_ht.resize(__hint); }
00410   size_type bucket_count() const { return _M_ht.bucket_count(); }
00411   size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
00412   size_type elems_in_bucket(size_type __n) const
00413   { return _M_ht.elems_in_bucket(__n); }
00414 };
00415 
00416 #define _STLP_TEMPLATE_HEADER template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
00417 #define _STLP_TEMPLATE_CONTAINER hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>
00418 #include <stl/_relops_hash_cont.h>
00419 #undef _STLP_TEMPLATE_CONTAINER
00420 #define _STLP_TEMPLATE_CONTAINER hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>
00421 #include <stl/_relops_hash_cont.h>
00422 #undef _STLP_TEMPLATE_CONTAINER
00423 #undef _STLP_TEMPLATE_HEADER
00424 
00425 #if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
00426 #  if !defined (_STLP_NO_MOVE_SEMANTIC)
00427 template <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
00428 struct __move_traits<hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > :
00429   _STLP_PRIV __move_traits_help<typename hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>::_Ht>
00430 {};
00431 
00432 template <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
00433 struct __move_traits<hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> > :
00434   _STLP_PRIV __move_traits_help<typename hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc>::_Ht>
00435 {};
00436 #  endif
00437 
00438 // Specialization of insert_iterator so that it will work for hash_map
00439 // and hash_multimap.
00440 template <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
00441 class insert_iterator<hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
00442 protected:
00443   typedef hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container;
00444   _Container* container;
00445 public:
00446   typedef _Container          container_type;
00447   typedef output_iterator_tag iterator_category;
00448   typedef void                value_type;
00449   typedef void                difference_type;
00450   typedef void                pointer;
00451   typedef void                reference;
00452 
00453   insert_iterator(_Container& __x) : container(&__x) {}
00454   insert_iterator(_Container& __x, typename _Container::iterator)
00455     : container(&__x) {}
00456   insert_iterator<_Container>&
00457   operator=(const typename _Container::value_type& __val) {
00458     container->insert(__val);
00459     return *this;
00460   }
00461   insert_iterator<_Container>& operator*() { return *this; }
00462   insert_iterator<_Container>& operator++() { return *this; }
00463   insert_iterator<_Container>& operator++(int) { return *this; }
00464 };
00465 
00466 template <class _Key, class _Tp, class _HashFn,  class _EqKey, class _Alloc>
00467 class insert_iterator<hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
00468 protected:
00469   typedef hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container;
00470   _Container* container;
00471   typename _Container::iterator iter;
00472 public:
00473   typedef _Container          container_type;
00474   typedef output_iterator_tag iterator_category;
00475   typedef void                value_type;
00476   typedef void                difference_type;
00477   typedef void                pointer;
00478   typedef void                reference;
00479 
00480   insert_iterator(_Container& __x) : container(&__x) {}
00481   insert_iterator(_Container& __x, typename _Container::iterator)
00482     : container(&__x) {}
00483   insert_iterator<_Container>&
00484   operator=(const typename _Container::value_type& __val) {
00485     container->insert(__val);
00486     return *this;
00487   }
00488   insert_iterator<_Container>& operator*() { return *this; }
00489   insert_iterator<_Container>& operator++() { return *this; }
00490   insert_iterator<_Container>& operator++(int) { return *this; }
00491 };
00492 #endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */
00493 
00494 _STLP_END_NAMESPACE
00495 
00496 #endif /* _STLP_INTERNAL_HASH_MAP_H */
00497 
00498 // Local Variables:
00499 // mode:C++
00500 // End:

Generated on Sun May 27 2012 04:29:03 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.