STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
_Hash< _Traits > Class Template Reference
Inheritance diagram for _Hash< _Traits >:
stdext::hash_map< _Kty, _Ty, _Tr, _Alloc > stdext::hash_multimap< _Kty, _Ty, _Tr, _Alloc > stdext::hash_multiset< _Kty, _Tr, _Alloc > stdext::hash_set< _Kty, _Tr, _Alloc >

Public Types

enum  { _Bucket_size = key_compare::bucket_size, _Min_buckets = 8, _Multi = _Traits::_Multi }
 
typedef _Hash< _Traits > _Myt
 
typedef _Traits::key_type key_type
 
typedef _Traits::key_compare key_compare
 
typedef _Traits::value_compare value_compare
 
typedef list< typename _Traits::value_type, typename _Traits::allocator_type > _Mylist
 
typedef _Mylist::_Alty _Alty
 
typedef _Mylist::value_type value_type
 
typedef _Mylist::allocator_type allocator_type
 
typedef _Mylist::size_type size_type
 
typedef _Mylist::difference_type difference_type
 
typedef _Mylist::pointer pointer
 
typedef _Mylist::const_pointer const_pointer
 
typedef _Mylist::reference reference
 
typedef _Mylist::const_reference const_reference
 
typedef _If< is_same< key_type, value_type >::value, typename _Mylist::const_iterator, typename _Mylist::iterator >::type iterator
 
typedef _Mylist::const_iterator const_iterator
 
typedef _If< is_same< key_type, value_type >::value, typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator >::type _Unchecked_iterator
 
typedef _Mylist::_Unchecked_const_iterator _Unchecked_const_iterator
 
typedef vector< _Unchecked_iterator, typename _Alty::template rebind< _Unchecked_iterator >::other > _Myvec
 
typedef pair< iterator, bool_Pairib
 
typedef pair< iterator, iterator_Pairii
 
typedef pair< const_iterator, const_iterator_Paircc
 
typedef iterator local_iterator
 
typedef const_iterator const_local_iterator
 

Public Member Functions

 _Hash (const key_compare &_Parg, const allocator_type &_Al)
 
template<class _Any_alloc >
 _Hash (const _Myt &_Right, const _Any_alloc &_Al)
 
 _Hash (_Myt &&_Right)
 
 _Hash (_Myt &&_Right, const allocator_type &_Al)
 
_Mytoperator= (_Myt &&_Right)
 
void _Assign_rv (_Myt &&_Right)
 
template<class... _Valty>
_Pairib emplace (_Valty &&..._Val)
 
template<class... _Valty>
iterator emplace_hint (const_iterator, _Valty &&..._Val)
 
 ~_Hash () _NOEXCEPT
 
_Mytoperator= (const _Myt &_Right)
 
iterator begin () _NOEXCEPT
 
const_iterator begin () const _NOEXCEPT
 
iterator end () _NOEXCEPT
 
const_iterator end () const _NOEXCEPT
 
_Unchecked_iterator _Unchecked_begin ()
 
_Unchecked_const_iterator _Unchecked_begin () const
 
_Unchecked_iterator _Unchecked_end ()
 
_Unchecked_const_iterator _Unchecked_end () const
 
iterator _Make_iter (_Unchecked_const_iterator _Where) const
 
iterator _Make_iter (const_iterator _Where) const
 
const_iterator cbegin () const _NOEXCEPT
 
const_iterator cend () const _NOEXCEPT
 
size_type size () const _NOEXCEPT
 
size_type max_size () const _NOEXCEPT
 
bool empty () const _NOEXCEPT
 
allocator_type get_allocator () const _NOEXCEPT
 
key_compare key_comp () const
 
value_compare value_comp () const
 
size_type bucket_count () const _NOEXCEPT
 
size_type max_bucket_count () const _NOEXCEPT
 
size_type bucket (const key_type &_Keyval) const
 
size_type bucket_size (size_type _Bucket) const
 
local_iterator begin (size_type _Bucket)
 
const_local_iterator begin (size_type _Bucket) const
 
local_iterator end (size_type _Bucket)
 
const_local_iterator end (size_type _Bucket) const
 
const_local_iterator cbegin (size_type _Bucket) const
 
const_local_iterator cend (size_type _Bucket) const
 
float load_factor () const _NOEXCEPT
 
float max_load_factor () const _NOEXCEPT
 
void max_load_factor (float _Newmax)
 
void rehash (size_type _Buckets)
 
void reserve (size_type _Maxcount)
 
template<bool _Multi2 = _Multi, enable_if_t<!_Multi2, int > = 0>
_Pairib insert (const value_type &_Val)
 
template<bool _Multi2 = _Multi, enable_if_t< _Multi2, int > = 0>
iterator insert (const value_type &_Val)
 
template<bool _Multi2 = _Multi, enable_if_t<!_Multi2, int > = 0>
_Pairib insert (value_type &&_Val)
 
template<bool _Multi2 = _Multi, enable_if_t< _Multi2, int > = 0>
iterator insert (value_type &&_Val)
 
iterator insert (const_iterator, const value_type &_Val)
 
iterator insert (const_iterator, value_type &&_Val)
 
template<class _Iter >
void insert (_Iter _First, _Iter _Last)
 
void insert (_XSTD initializer_list< value_type > _Ilist)
 
iterator erase (const_iterator _Plist)
 
iterator erase (const_iterator _First, const_iterator _Last)
 
size_type erase (const key_type &_Keyval)
 
void clear () _NOEXCEPT
 
iterator find (const key_type &_Keyval)
 
const_iterator find (const key_type &_Keyval) const
 
size_type count (const key_type &_Keyval) const
 
iterator lower_bound (const key_type &_Keyval)
 
const_iterator lower_bound (const key_type &_Keyval) const
 
iterator upper_bound (const key_type &_Keyval)
 
const_iterator upper_bound (const key_type &_Keyval) const
 
_Pairii equal_range (const key_type &_Keyval)
 
_Paircc equal_range (const key_type &_Keyval) const
 
void swap (_Myt &_Right)
 

Protected Member Functions

template<class _Valty >
_Unchecked_iterator _Buynode_if_nil (_Valty &&, _Unchecked_iterator _Plist)
 
template<class _Valty >
_Unchecked_iterator _Buynode_if_nil (_Valty &&_Val, _Nil)
 
void _Destroy_if_not_nil (_Unchecked_iterator _Plist)
 
void _Destroy_if_not_nil (_Nil)
 
template<class _Valty , class _Nodety >
_Pairib _Insert (_Valty &&_Val, _Nodety _Pnode)
 
_Unchecked_iterator_Vec_lo (size_type _Bucket)
 
_Unchecked_const_iterator_Vec_lo (size_type _Bucket) const
 
_Unchecked_iterator_Vec_hi (size_type _Bucket)
 
_Unchecked_const_iterator_Vec_hi (size_type _Bucket) const
 
_Unchecked_iterator _Begin (size_type _Bucket)
 
_Unchecked_const_iterator _Begin (size_type _Bucket) const
 
_Unchecked_iterator _End (size_type _Bucket)
 
_Unchecked_const_iterator _End (size_type _Bucket) const
 
void _Erase_bucket (iterator _Plist_arg, size_type _Bucket)
 
void _Insert_bucket (_Unchecked_iterator _Plist, _Unchecked_iterator _Where, size_type _Bucket)
 
void _Copy (const _Myt &_Right)
 
size_type _Hashval (const key_type &_Keyval) const
 
void _Init (size_type _Buckets=_Min_buckets)
 
void _Check_size ()
 
void _Reinsert ()
 
float & _Max_bucket_size () _NOEXCEPT
 
const float & _Max_bucket_size () const _NOEXCEPT
 

Protected Attributes

_Traits _Traitsobj
 
_Mylist _List
 
_Myvec _Vec
 
size_type _Mask
 
size_type _Maxidx
 

Member Typedef Documentation

template<class _Traits>
typedef _Mylist::_Alty _Hash< _Traits >::_Alty
template<class _Traits>
typedef list<typename _Traits::value_type, typename _Traits::allocator_type> _Hash< _Traits >::_Mylist
template<class _Traits>
typedef _Hash<_Traits> _Hash< _Traits >::_Myt
template<class _Traits>
typedef vector<_Unchecked_iterator, typename _Alty::template rebind<_Unchecked_iterator>::other> _Hash< _Traits >::_Myvec
template<class _Traits>
typedef pair<const_iterator, const_iterator> _Hash< _Traits >::_Paircc
template<class _Traits>
typedef pair<iterator, bool> _Hash< _Traits >::_Pairib
template<class _Traits>
typedef pair<iterator, iterator> _Hash< _Traits >::_Pairii
template<class _Traits>
typedef _Mylist::_Unchecked_const_iterator _Hash< _Traits >::_Unchecked_const_iterator
template<class _Traits>
typedef _If<is_same<key_type, value_type>::value, typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator>::type _Hash< _Traits >::_Unchecked_iterator
template<class _Traits>
typedef _Mylist::allocator_type _Hash< _Traits >::allocator_type
template<class _Traits>
typedef _Mylist::const_iterator _Hash< _Traits >::const_iterator
template<class _Traits>
typedef const_iterator _Hash< _Traits >::const_local_iterator
template<class _Traits>
typedef _Mylist::const_pointer _Hash< _Traits >::const_pointer
template<class _Traits>
typedef _Mylist::const_reference _Hash< _Traits >::const_reference
template<class _Traits>
typedef _Mylist::difference_type _Hash< _Traits >::difference_type
template<class _Traits>
typedef _If<is_same<key_type, value_type>::value, typename _Mylist::const_iterator, typename _Mylist::iterator>::type _Hash< _Traits >::iterator
template<class _Traits>
typedef _Traits::key_compare _Hash< _Traits >::key_compare
template<class _Traits>
typedef _Traits::key_type _Hash< _Traits >::key_type
template<class _Traits>
typedef iterator _Hash< _Traits >::local_iterator
template<class _Traits>
typedef _Mylist::pointer _Hash< _Traits >::pointer
template<class _Traits>
typedef _Mylist::reference _Hash< _Traits >::reference
template<class _Traits>
typedef _Mylist::size_type _Hash< _Traits >::size_type
template<class _Traits>
typedef _Traits::value_compare _Hash< _Traits >::value_compare
template<class _Traits>
typedef _Mylist::value_type _Hash< _Traits >::value_type

Member Enumeration Documentation

template<class _Traits>
anonymous enum
Enumerator
_Bucket_size 
_Min_buckets 
_Multi 
156  { // various constants
157  _Bucket_size = key_compare::bucket_size,
158  _Min_buckets = 8, // min_buckets = 2 ^^ N, 0 < N
159  _Multi = _Traits::_Multi};
Definition: xhash:158
Definition: xhash:159
Definition: xhash:157

Constructor & Destructor Documentation

template<class _Traits>
_Hash< _Traits >::_Hash ( const key_compare _Parg,
const allocator_type _Al 
)
inline
195  : _Traitsobj(_Parg),
196 
197  _List(_Al),
198  _Vec(_Al)
199 
200  { // construct empty hash table
202  _Init();
203  }
Definition: xhash:157
_Mylist _List
Definition: xhash:911
_Traits _Traitsobj
Definition: xhash:910
float & _Max_bucket_size() _NOEXCEPT
Definition: xhash:900
void _Init(size_type _Buckets=_Min_buckets)
Definition: xhash:862
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
template<class _Any_alloc >
_Hash< _Traits >::_Hash ( const _Myt _Right,
const _Any_alloc &  _Al 
)
inline
207  : _Traitsobj(_Right._Traitsobj),
208  _List(allocator_type(_Al)),
209  _Vec(_Al)
210  { // construct hash table by copying right
211  _Copy(_Right);
212  }
_Mylist::allocator_type allocator_type
Definition: xhash:165
void _Copy(const _Myt &_Right)
Definition: xhash:841
_Mylist _List
Definition: xhash:911
_Traits _Traitsobj
Definition: xhash:910
constexpr const _Ty &() _Right
Definition: algorithm:3591
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
_Hash< _Traits >::_Hash ( _Myt &&  _Right)
inline
215  : _Traitsobj(_Right._Traitsobj),
216 
217  _List(_STD move(_Right._List)),
218  _Vec(_STD move(_Right._Vec)),
219  _Mask(_Right._Mask),
220  _Maxidx(_Right._Maxidx)
221 
222  { // construct hash table by moving _Right
223  _Right.clear();
224  }
size_type _Mask
Definition: xhash:913
_Mylist _List
Definition: xhash:911
size_type _Maxidx
Definition: xhash:914
_Traits _Traitsobj
Definition: xhash:910
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
constexpr const _Ty &() _Right
Definition: algorithm:3591
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
_Hash< _Traits >::_Hash ( _Myt &&  _Right,
const allocator_type _Al 
)
inline
227  : _Traitsobj(_Right._Traitsobj),
228 
229  _List(_STD move(_Right._List), _Al),
230  _Vec(_STD move(_Right._Vec), _Al),
231  _Mask(_Right._Mask),
232  _Maxidx(_Right._Maxidx)
233 
234  { // construct hash table by moving _Right, allocator
235  _Right.clear();
236  }
size_type _Mask
Definition: xhash:913
_Mylist _List
Definition: xhash:911
size_type _Maxidx
Definition: xhash:914
_Traits _Traitsobj
Definition: xhash:910
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
constexpr const _Ty &() _Right
Definition: algorithm:3591
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
_Hash< _Traits >::~_Hash ( )
inline
266  { // destroy hash table
267 // _List.clear(); // speed orphaning of checked iterators
268  }

Member Function Documentation

template<class _Traits>
void _Hash< _Traits >::_Assign_rv ( _Myt &&  _Right)
inline
246  { // assign by moving _Right
247  _Right.swap(*this);
248  _Right.clear();
249  }
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Traits>
_Unchecked_iterator _Hash< _Traits >::_Begin ( size_type  _Bucket)
inlineprotected
782  { // return begin iterator for bucket _Bucket
783  return (_Vec_lo(_Bucket));
784  }
_Unchecked_iterator & _Vec_lo(size_type _Bucket)
Definition: xhash:761
template<class _Traits>
_Unchecked_const_iterator _Hash< _Traits >::_Begin ( size_type  _Bucket) const
inlineprotected
787  { // return begin iterator for bucket _Bucket
788  return (_Vec_lo(_Bucket));
789  }
_Unchecked_iterator & _Vec_lo(size_type _Bucket)
Definition: xhash:761
template<class _Traits>
template<class _Valty >
_Unchecked_iterator _Hash< _Traits >::_Buynode_if_nil ( _Valty &&  ,
_Unchecked_iterator  _Plist 
)
inlineprotected
690  { // node exists, just return it
691  return (_Plist);
692  }
template<class _Traits>
template<class _Valty >
_Unchecked_iterator _Hash< _Traits >::_Buynode_if_nil ( _Valty &&  _Val,
_Nil   
)
inlineprotected
696  { // node doesn't exist, make it
697  _List.push_front(_STD forward<_Valty>(_Val));
698  return (_Unchecked_begin());
699  }
void push_front(_Ty &&_Val)
Definition: list:1019
_In_ int _Val
Definition: vcruntime_string.h:62
_Mylist _List
Definition: xhash:911
_Unchecked_iterator _Unchecked_begin()
Definition: xhash:297
template<class _Traits>
void _Hash< _Traits >::_Check_size ( )
inlineprotected
871  { // grow table as needed
872  if (max_load_factor() < load_factor())
873 
874  { // rehash to bigger table
875  size_type _Newsize = bucket_count();
876 
877  if (_Newsize < 512)
878  _Newsize *= 8; // multiply by 8
879  else if (_Newsize < _Vec.max_size() / 2)
880  _Newsize *= 2; // multiply safely by 2
881  _Init(_Newsize);
882  _Reinsert();
883  }
884  }
size_type max_size() const _NOEXCEPT
Definition: vector:1183
size_type bucket_count() const _NOEXCEPT
Definition: xhash:371
void _Reinsert()
Definition: xhash:886
_Mylist::size_type size_type
Definition: xhash:166
float max_load_factor() const _NOEXCEPT
Definition: xhash:449
float load_factor() const _NOEXCEPT
Definition: xhash:444
void _Init(size_type _Buckets=_Min_buckets)
Definition: xhash:862
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
void _Hash< _Traits >::_Copy ( const _Myt _Right)
inlineprotected
842  { // copy entire hash table
843  _Mask = _Right._Mask;
844  _Maxidx = _Right._Maxidx;
845  _List.clear();
846 
847  _TRY_BEGIN
848  _Traitsobj = _Right._Traitsobj;
849  _Vec.assign(_Right._Vec.size(), _Unchecked_end());
850  insert(_Right.begin(), _Right.end());
851  _CATCH_ALL
852  clear(); // list or compare copy failed, bail out
853  _RERAISE;
854  _CATCH_END
855  }
void clear() _NOEXCEPT
Definition: list:1499
size_type _Mask
Definition: xhash:913
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
_Unchecked_iterator _Unchecked_end()
Definition: xhash:307
_Pairib insert(const value_type &_Val)
Definition: xhash:487
void clear() _NOEXCEPT
Definition: xhash:569
_Mylist _List
Definition: xhash:911
size_type _Maxidx
Definition: xhash:914
#define _CATCH_ALL
Definition: xstddef:62
void assign(_XSTD initializer_list< value_type > _Ilist)
Definition: vector:963
_Traits _Traitsobj
Definition: xhash:910
#define _RERAISE
Definition: xstddef:74
constexpr const _Ty &() _Right
Definition: algorithm:3591
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
void _Hash< _Traits >::_Destroy_if_not_nil ( _Unchecked_iterator  _Plist)
inlineprotected
702  { // node exists, destroy it
703  _List.erase(_Make_iter(_Plist));
704  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
_Mylist _List
Definition: xhash:911
iterator erase(const_iterator _Where)
Definition: list:1465
template<class _Traits>
void _Hash< _Traits >::_Destroy_if_not_nil ( _Nil  )
inlineprotected
707  { // node doesn't exist, do nothing
708  }
template<class _Traits>
_Unchecked_iterator _Hash< _Traits >::_End ( size_type  _Bucket)
inlineprotected
792  { // return end iterator for bucket _Bucket
793  if (_Vec_lo(_Bucket) == _Unchecked_end())
794  return (_Unchecked_end());
795  else
796  { // point past last element
797  _Unchecked_iterator _Ans = _Vec_hi(_Bucket);
798  return (++_Ans);
799  }
800  }
_Unchecked_iterator & _Vec_hi(size_type _Bucket)
Definition: xhash:771
_Unchecked_iterator _Unchecked_end()
Definition: xhash:307
_Unchecked_iterator & _Vec_lo(size_type _Bucket)
Definition: xhash:761
_If< is_same< key_type, value_type >::value, typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator >::type _Unchecked_iterator
Definition: xhash:181
template<class _Traits>
_Unchecked_const_iterator _Hash< _Traits >::_End ( size_type  _Bucket) const
inlineprotected
802  { // return end iterator for bucket _Bucket
803  if (_Vec_lo(_Bucket) == _Unchecked_end())
804  return (_Unchecked_end());
805  else
806  { // point past last element
807  _Unchecked_const_iterator _Ans = _Vec_hi(_Bucket);
808  return (++_Ans);
809  }
810  }
_Unchecked_iterator & _Vec_hi(size_type _Bucket)
Definition: xhash:771
_Unchecked_iterator _Unchecked_end()
Definition: xhash:307
_Mylist::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: xhash:183
_Unchecked_iterator & _Vec_lo(size_type _Bucket)
Definition: xhash:761
template<class _Traits>
void _Hash< _Traits >::_Erase_bucket ( iterator  _Plist_arg,
size_type  _Bucket 
)
inlineprotected
813  { // fix iterators before erasing _Plist before _Where
814  _Unchecked_iterator _Plist = _Plist_arg._Unchecked();
815  if (_Vec_hi(_Bucket) == _Plist)
816  if (_Vec_lo(_Bucket) == _Plist)
817  { // make bucket empty
818  _Vec_lo(_Bucket) = _Unchecked_end();
819  _Vec_hi(_Bucket) = _Unchecked_end();
820  }
821  else
822  _Vec_hi(_Bucket) = --_Plist; // move end back one element
823  else if (_Vec_lo(_Bucket) == _Plist)
824  _Vec_lo(_Bucket) = ++_Plist; // move beginning up one element
825  }
_Unchecked_iterator & _Vec_hi(size_type _Bucket)
Definition: xhash:771
_Unchecked_iterator _Unchecked_end()
Definition: xhash:307
_Unchecked_iterator & _Vec_lo(size_type _Bucket)
Definition: xhash:761
_If< is_same< key_type, value_type >::value, typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator >::type _Unchecked_iterator
Definition: xhash:181
template<class _Traits>
size_type _Hash< _Traits >::_Hashval ( const key_type _Keyval) const
inlineprotected
858  { // return hash value, masked to current table size
859  return (_Traitsobj(_Keyval) & _Mask);
860  }
size_type _Mask
Definition: xhash:913
_Traits _Traitsobj
Definition: xhash:910
template<class _Traits>
void _Hash< _Traits >::_Init ( size_type  _Buckets = _Min_buckets)
inlineprotected
863  { // initialize hash table with _Buckets buckets, leave list alone
864  _Vec.reserve(2 * _Buckets); // avoid curdling _Vec if exception occurs
865  _Vec.assign(2 * _Buckets, _Unchecked_end());
866  _Mask = _Buckets - 1;
867  _Maxidx = _Buckets;
868  }
size_type _Mask
Definition: xhash:913
_Unchecked_iterator _Unchecked_end()
Definition: xhash:307
void reserve(size_type _Count)
Definition: vector:1031
size_type _Maxidx
Definition: xhash:914
void assign(_XSTD initializer_list< value_type > _Ilist)
Definition: vector:963
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
template<class _Valty , class _Nodety >
_Pairib _Hash< _Traits >::_Insert ( _Valty &&  _Val,
_Nodety  _Pnode 
)
inlineprotected
713  { // try to insert existing node with value _Val
714  size_type _Bucket;
715  _Unchecked_iterator _Where;
716 
717  _TRY_BEGIN
718  _Bucket = _Hashval(_Traits::_Kfn(_Val));
719  _Where = _End(_Bucket);
720  for (; _Where != _Begin(_Bucket); )
721  if (_Traitsobj(_Traits::_Kfn(_Val),
722  _Traits::_Kfn(*--_Where)))
723  ; // still too high in bucket list
724  else if (_Multi
725  || (!_Traits::_Standard
726  && _Traitsobj(_Traits::_Kfn(*_Where),
727  _Traits::_Kfn(_Val))))
728  { // found insertion point, back up to it
729  ++_Where;
730  break;
731  }
732  else
733  { // discard new list element and return existing
734  _Destroy_if_not_nil(_Pnode);
735  return (_Pairib(_Make_iter(_Where), false));
736  }
737  _CATCH_ALL
738  _Destroy_if_not_nil(_Pnode);
739  _RERAISE;
740  _CATCH_END
741 
742  _Unchecked_iterator _Plist =
743  _Buynode_if_nil(_STD forward<_Valty>(_Val), _Pnode);
744  _Unchecked_iterator _Next = _Plist;
745 
746  if (_Where != ++_Next) // move element into place
747  _List._Unchecked_splice(_Where, _Plist, _Next);
748 
749  _Insert_bucket(_Plist, _Where, _Bucket);
750 
751  _TRY_BEGIN
752  _Check_size();
753  _CATCH_ALL
754  erase(_Make_iter(_Plist));
755  _RERAISE;
756  _CATCH_END
757 
758  return (_Pairib(_Make_iter(_Plist), true));
759  }
_Unchecked_iterator _Buynode_if_nil(_Valty &&, _Unchecked_iterator _Plist)
Definition: xhash:688
Definition: xhash:159
#define _TRY_BEGIN
Definition: xstddef:60
void _Check_size()
Definition: xhash:870
#define _CATCH_END
Definition: xstddef:63
_In_ int _Val
Definition: vcruntime_string.h:62
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
void _Insert_bucket(_Unchecked_iterator _Plist, _Unchecked_iterator _Where, size_type _Bucket)
Definition: xhash:827
void _Destroy_if_not_nil(_Unchecked_iterator _Plist)
Definition: xhash:701
pair< iterator, bool > _Pairib
Definition: xhash:189
_Mylist _List
Definition: xhash:911
#define _CATCH_ALL
Definition: xstddef:62
_Unchecked_iterator _End(size_type _Bucket)
Definition: xhash:791
_Traits _Traitsobj
Definition: xhash:910
_Mylist::size_type size_type
Definition: xhash:166
_Unchecked_iterator _Begin(size_type _Bucket)
Definition: xhash:781
size_type _Hashval(const key_type &_Keyval) const
Definition: xhash:857
iterator erase(const_iterator _Plist)
Definition: xhash:537
void _Unchecked_splice(_Unchecked_const_iterator _Where, _Unchecked_const_iterator _First, _Unchecked_const_iterator _Last)
Definition: list:1863
#define _RERAISE
Definition: xstddef:74
_If< is_same< key_type, value_type >::value, typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator >::type _Unchecked_iterator
Definition: xhash:181
template<class _Traits>
void _Hash< _Traits >::_Insert_bucket ( _Unchecked_iterator  _Plist,
_Unchecked_iterator  _Where,
size_type  _Bucket 
)
inlineprotected
829  { // fix iterators after inserting _Plist before _Where
830  if (_Vec_lo(_Bucket) == _Unchecked_end())
831  { // make bucket non-empty
832  _Vec_lo(_Bucket) = _Plist;
833  _Vec_hi(_Bucket) = _Plist;
834  }
835  else if (_Vec_lo(_Bucket) == _Where)
836  _Vec_lo(_Bucket) = _Plist; // move beginning back one element
837  else if (++_Vec_hi(_Bucket) != _Plist) // move end up one element
838  --_Vec_hi(_Bucket); // or not
839  }
_Unchecked_iterator & _Vec_hi(size_type _Bucket)
Definition: xhash:771
_Unchecked_iterator _Unchecked_end()
Definition: xhash:307
_Unchecked_iterator & _Vec_lo(size_type _Bucket)
Definition: xhash:761
template<class _Traits>
iterator _Hash< _Traits >::_Make_iter ( _Unchecked_const_iterator  _Where) const
inline
318  { // make iterator from _Unchecked_const_iterator
319  return (_List._Make_iter(_Where));
320  }
_Mylist _List
Definition: xhash:911
iterator _Make_iter(const_iterator _Where) const _NOEXCEPT
Definition: list:1162
template<class _Traits>
iterator _Hash< _Traits >::_Make_iter ( const_iterator  _Where) const
inline
323  { // make iterator from const_iterator
324  return (_List._Make_iter(_Where));
325  }
_Mylist _List
Definition: xhash:911
iterator _Make_iter(const_iterator _Where) const _NOEXCEPT
Definition: list:1162
template<class _Traits>
float& _Hash< _Traits >::_Max_bucket_size ( )
inlineprotected
901  { // return reference to current maximum bucket size
902  return (_Traitsobj._Get_max_bucket_size());
903  }
_Traits _Traitsobj
Definition: xhash:910
template<class _Traits>
const float& _Hash< _Traits >::_Max_bucket_size ( ) const
inlineprotected
906  { // return const reference to current maximum bucket size
907  return (_Traitsobj._Get_max_bucket_size());
908  }
_Traits _Traitsobj
Definition: xhash:910
template<class _Traits>
void _Hash< _Traits >::_Reinsert ( )
inlineprotected
887  { // insert elements in [begin(), end())
889  if (_Unchecked_begin() != _Last)
890  for (--_Last; ; )
891  { // reinsert elements in [begin(), _Last]
893  bool _Done = _First == _Last;
894  _Insert(*_First, _First);
895  if (_Done)
896  break;
897  }
898  }
_Unchecked_iterator _Unchecked_end()
Definition: xhash:307
_Pairib _Insert(_Valty &&_Val, _Nodety _Pnode)
Definition: xhash:712
_Unchecked_iterator _Unchecked_begin()
Definition: xhash:297
_FwdIt _Last
Definition: algorithm:1936
_If< is_same< key_type, value_type >::value, typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator >::type _Unchecked_iterator
Definition: xhash:181
template<class _Traits>
_Unchecked_iterator _Hash< _Traits >::_Unchecked_begin ( )
inline
298  { // return iterator for beginning of mutable sequence
299  return (_List._Unchecked_begin());
300  }
_Unchecked_iterator _Unchecked_begin()
Definition: list:1139
_Mylist _List
Definition: xhash:911
template<class _Traits>
_Unchecked_const_iterator _Hash< _Traits >::_Unchecked_begin ( ) const
inline
303  { // return iterator for beginning of nonmutable sequence
304  return (_List._Unchecked_begin());
305  }
_Unchecked_iterator _Unchecked_begin()
Definition: list:1139
_Mylist _List
Definition: xhash:911
template<class _Traits>
_Unchecked_iterator _Hash< _Traits >::_Unchecked_end ( )
inline
308  { // return iterator for end of mutable sequence
309  return (_List._Unchecked_end());
310  }
_Unchecked_iterator _Unchecked_end()
Definition: list:1151
_Mylist _List
Definition: xhash:911
template<class _Traits>
_Unchecked_const_iterator _Hash< _Traits >::_Unchecked_end ( ) const
inline
313  { // return iterator for end of nonmutable sequence
314  return (_List._Unchecked_end());
315  }
_Unchecked_iterator _Unchecked_end()
Definition: list:1151
_Mylist _List
Definition: xhash:911
template<class _Traits>
_Unchecked_iterator& _Hash< _Traits >::_Vec_hi ( size_type  _Bucket)
inlineprotected
772  { // return reference to end()-1 for _Bucket
773  return (_Vec[2 * _Bucket + 1]);
774  }
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
_Unchecked_const_iterator& _Hash< _Traits >::_Vec_hi ( size_type  _Bucket) const
inlineprotected
777  { // return reference to end()-1 for _Bucket
778  return ((_Unchecked_const_iterator&)_Vec[2 * _Bucket + 1]);
779  }
_Mylist::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: xhash:183
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
_Unchecked_iterator& _Hash< _Traits >::_Vec_lo ( size_type  _Bucket)
inlineprotected
762  { // return reference to begin() for _Bucket
763  return (_Vec[2 * _Bucket]);
764  }
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
_Unchecked_const_iterator& _Hash< _Traits >::_Vec_lo ( size_type  _Bucket) const
inlineprotected
767  { // return reference to begin() for _Bucket
768  return ((_Unchecked_const_iterator&)_Vec[2 * _Bucket]);
769  }
_Mylist::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: xhash:183
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
iterator _Hash< _Traits >::begin ( )
inline
278  { // return iterator for beginning of mutable sequence
279  return (_List.begin());
280  }
iterator begin() _NOEXCEPT
Definition: list:1117
_Mylist _List
Definition: xhash:911
template<class _Traits>
const_iterator _Hash< _Traits >::begin ( ) const
inline
283  { // return iterator for beginning of nonmutable sequence
284  return (_List.begin());
285  }
iterator begin() _NOEXCEPT
Definition: list:1117
_Mylist _List
Definition: xhash:911
template<class _Traits>
local_iterator _Hash< _Traits >::begin ( size_type  _Bucket)
inline
397  { // return iterator for bucket _Bucket
398  if (_Bucket < bucket_count())
399  return (_Make_iter(_Begin(_Bucket)));
400  else
401  return (end());
402  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
size_type bucket_count() const _NOEXCEPT
Definition: xhash:371
iterator end() _NOEXCEPT
Definition: xhash:287
_Unchecked_iterator _Begin(size_type _Bucket)
Definition: xhash:781
template<class _Traits>
const_local_iterator _Hash< _Traits >::begin ( size_type  _Bucket) const
inline
405  { // return iterator for bucket _Bucket
406  if (_Bucket < bucket_count())
407  return (_Make_iter(_Begin(_Bucket)));
408  else
409  return (end());
410  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
size_type bucket_count() const _NOEXCEPT
Definition: xhash:371
iterator end() _NOEXCEPT
Definition: xhash:287
_Unchecked_iterator _Begin(size_type _Bucket)
Definition: xhash:781
template<class _Traits>
size_type _Hash< _Traits >::bucket ( const key_type _Keyval) const
inline
382  { // return bucket corresponding to _Key
383  return (_Hashval(_Keyval));
384  }
size_type _Hashval(const key_type &_Keyval) const
Definition: xhash:857
template<class _Traits>
size_type _Hash< _Traits >::bucket_count ( ) const
inline
372  { // return number of buckets
373  return (_Maxidx);
374  }
size_type _Maxidx
Definition: xhash:914
template<class _Traits>
size_type _Hash< _Traits >::bucket_size ( size_type  _Bucket) const
inline
387  { // return size of bucket _Bucket
388  size_type _Ans = 0;
389  if (_Bucket < _Maxidx)
390  for (_Unchecked_const_iterator _Plist = _Begin(_Bucket);
391  _Plist != _End(_Bucket); ++_Plist)
392  ++_Ans;
393  return (_Ans);
394  }
_Mylist::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: xhash:183
size_type _Maxidx
Definition: xhash:914
_Unchecked_iterator _End(size_type _Bucket)
Definition: xhash:791
_Mylist::size_type size_type
Definition: xhash:166
_Unchecked_iterator _Begin(size_type _Bucket)
Definition: xhash:781
template<class _Traits>
const_iterator _Hash< _Traits >::cbegin ( ) const
inline
328  { // return iterator for beginning of nonmutable sequence
329  return (begin());
330  }
iterator begin() _NOEXCEPT
Definition: xhash:277
template<class _Traits>
const_local_iterator _Hash< _Traits >::cbegin ( size_type  _Bucket) const
inline
429  { // return iterator for bucket _Bucket
430  if (_Bucket < bucket_count())
431  return (_Make_iter(_Begin(_Bucket)));
432  else
433  return (end());
434  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
size_type bucket_count() const _NOEXCEPT
Definition: xhash:371
iterator end() _NOEXCEPT
Definition: xhash:287
_Unchecked_iterator _Begin(size_type _Bucket)
Definition: xhash:781
template<class _Traits>
const_iterator _Hash< _Traits >::cend ( ) const
inline
333  { // return iterator for end of nonmutable sequence
334  return (end());
335  }
iterator end() _NOEXCEPT
Definition: xhash:287
template<class _Traits>
const_local_iterator _Hash< _Traits >::cend ( size_type  _Bucket) const
inline
437  { // return iterator for bucket following _Bucket
438  if (_Bucket < bucket_count())
439  return (_Make_iter(_End(_Bucket)));
440  else
441  return (end());
442  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
size_type bucket_count() const _NOEXCEPT
Definition: xhash:371
_Unchecked_iterator _End(size_type _Bucket)
Definition: xhash:791
iterator end() _NOEXCEPT
Definition: xhash:287
template<class _Traits>
void _Hash< _Traits >::clear ( )
inline
570  { // erase all
571  _List.clear();
572  _Init();
573  }
void clear() _NOEXCEPT
Definition: list:1499
_Mylist _List
Definition: xhash:911
void _Init(size_type _Buckets=_Min_buckets)
Definition: xhash:862
template<class _Traits>
size_type _Hash< _Traits >::count ( const key_type _Keyval) const
inline
586  { // count all elements that match _Keyval
587  _Paircc _Ans = equal_range(_Keyval);
588  return (_STD distance(_Ans.first, _Ans.second));
589  }
pair< const_iterator, const_iterator > _Paircc
Definition: xhash:191
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1124
_Pairii equal_range(const key_type &_Keyval)
Definition: xhash:635
template<class _Traits>
template<class... _Valty>
_Pairib _Hash< _Traits >::emplace ( _Valty &&...  _Val)
inline
253  { // try to insert value_type(_Val...)
254  _List.emplace_front(_STD forward<_Valty>(_Val)...);
255  return (_Insert(_List.front(), _Unchecked_begin()));
256  }
void emplace_front(_Valty &&..._Val)
Definition: list:1035
_In_ int _Val
Definition: vcruntime_string.h:62
_Pairib _Insert(_Valty &&_Val, _Nodety _Pnode)
Definition: xhash:712
_Mylist _List
Definition: xhash:911
reference front()
Definition: list:1261
_Unchecked_iterator _Unchecked_begin()
Definition: xhash:297
template<class _Traits>
template<class... _Valty>
iterator _Hash< _Traits >::emplace_hint ( const_iterator  ,
_Valty &&...  _Val 
)
inline
260  { // try to insert value_type(_Val...), ignore hint
261  _List.emplace_front(_STD forward<_Valty>(_Val)...);
262  return (_Insert(_List.front(), _Unchecked_begin()).first);
263  }
void emplace_front(_Valty &&..._Val)
Definition: list:1035
_In_ int _Val
Definition: vcruntime_string.h:62
_Pairib _Insert(_Valty &&_Val, _Nodety _Pnode)
Definition: xhash:712
_Mylist _List
Definition: xhash:911
reference front()
Definition: list:1261
_Unchecked_iterator _Unchecked_begin()
Definition: xhash:297
template<class _Traits>
bool _Hash< _Traits >::empty ( ) const
inline
348  { // return true only if sequence is empty
349  return (_List.empty());
350  }
bool empty() const _NOEXCEPT
Definition: list:1250
_Mylist _List
Definition: xhash:911
template<class _Traits>
iterator _Hash< _Traits >::end ( )
inline
288  { // return iterator for end of mutable sequence
289  return (_List.end());
290  }
iterator end() _NOEXCEPT
Definition: list:1129
_Mylist _List
Definition: xhash:911
template<class _Traits>
const_iterator _Hash< _Traits >::end ( ) const
inline
293  { // return iterator for end of nonmutable sequence
294  return (_List.end());
295  }
iterator end() _NOEXCEPT
Definition: list:1129
_Mylist _List
Definition: xhash:911
template<class _Traits>
local_iterator _Hash< _Traits >::end ( size_type  _Bucket)
inline
413  { // return iterator for bucket following _Bucket
414  if (_Bucket < bucket_count())
415  return (_Make_iter(_End(_Bucket)));
416  else
417  return (end());
418  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
size_type bucket_count() const _NOEXCEPT
Definition: xhash:371
_Unchecked_iterator _End(size_type _Bucket)
Definition: xhash:791
iterator end() _NOEXCEPT
Definition: xhash:287
template<class _Traits>
const_local_iterator _Hash< _Traits >::end ( size_type  _Bucket) const
inline
421  { // return iterator for bucket following _Bucket
422  if (_Bucket < bucket_count())
423  return (_Make_iter(_End(_Bucket)));
424  else
425  return (end());
426  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
size_type bucket_count() const _NOEXCEPT
Definition: xhash:371
_Unchecked_iterator _End(size_type _Bucket)
Definition: xhash:791
iterator end() _NOEXCEPT
Definition: xhash:287
template<class _Traits>
_Pairii _Hash< _Traits >::equal_range ( const key_type _Keyval)
inline
636  { // find range equivalent to _Keyval in mutable hash table
637  size_type _Bucket = _Hashval(_Keyval);
638  for (_Unchecked_iterator _Where = _Begin(_Bucket);
639  _Where != _End(_Bucket); ++_Where)
640  if (!_Traitsobj(_Traits::_Kfn(*_Where), _Keyval))
641  { // found _First, look for end of range
642  _Unchecked_iterator _First = _Where;
643  for (; _Where != _End(_Bucket); ++_Where)
644  if (_Traitsobj(_Keyval, _Traits::_Kfn(*_Where)))
645  break;
646  if (_First == _Where)
647  break;
648  return (_Pairii(_Make_iter(_First),
649  _Make_iter(_Where)));
650  }
651  return (_Pairii(end(), end()));
652  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
_Unchecked_iterator _End(size_type _Bucket)
Definition: xhash:791
iterator end() _NOEXCEPT
Definition: xhash:287
_Traits _Traitsobj
Definition: xhash:910
pair< iterator, iterator > _Pairii
Definition: xhash:190
_Mylist::size_type size_type
Definition: xhash:166
_Unchecked_iterator _Begin(size_type _Bucket)
Definition: xhash:781
size_type _Hashval(const key_type &_Keyval) const
Definition: xhash:857
_If< is_same< key_type, value_type >::value, typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator >::type _Unchecked_iterator
Definition: xhash:181
template<class _Traits>
_Paircc _Hash< _Traits >::equal_range ( const key_type _Keyval) const
inline
655  { // find range equivalent to _Keyval in nonmutable hash table
656  size_type _Bucket = _Hashval(_Keyval);
657  for (_Unchecked_const_iterator _Where = _Begin(_Bucket);
658  _Where != _End(_Bucket); ++_Where)
659  if (!_Traitsobj(_Traits::_Kfn(*_Where), _Keyval))
660  { // found _First, look for end of range
661  _Unchecked_const_iterator _First = _Where;
662  for (; _Where != _End(_Bucket); ++_Where)
663  if (_Traitsobj(_Keyval, _Traits::_Kfn(*_Where)))
664  break;
665  if (_First == _Where)
666  break;
667  return (_Paircc(_Make_iter(_First),
668  _Make_iter(_Where)));
669  }
670  return (_Paircc(end(), end()));
671  }
pair< const_iterator, const_iterator > _Paircc
Definition: xhash:191
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
_Mylist::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: xhash:183
_Unchecked_iterator _End(size_type _Bucket)
Definition: xhash:791
iterator end() _NOEXCEPT
Definition: xhash:287
_Traits _Traitsobj
Definition: xhash:910
_Mylist::size_type size_type
Definition: xhash:166
_Unchecked_iterator _Begin(size_type _Bucket)
Definition: xhash:781
size_type _Hashval(const key_type &_Keyval) const
Definition: xhash:857
template<class _Traits>
iterator _Hash< _Traits >::erase ( const_iterator  _Plist)
inline
538  { // erase element at _Plist
539  size_type _Bucket = _Hashval(_Traits::_Kfn(*_Plist));
540 
541  _Erase_bucket(_Make_iter(_Plist), _Bucket);
542  return (_List.erase(_Plist));
543  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
void _Erase_bucket(iterator _Plist_arg, size_type _Bucket)
Definition: xhash:812
_Mylist _List
Definition: xhash:911
iterator erase(const_iterator _Where)
Definition: list:1465
_Mylist::size_type size_type
Definition: xhash:166
size_type _Hashval(const key_type &_Keyval) const
Definition: xhash:857
template<class _Traits>
iterator _Hash< _Traits >::erase ( const_iterator  _First,
const_iterator  _Last 
)
inline
546  { // erase [_First, _Last)
547  _DEBUG_RANGE(_First, _Last);
548  if (_First == begin() && _Last == end())
549  { // erase all
550  clear();
551  return (begin());
552  }
553  else
554  { // partial erase, one at a time
555  while (_First != _Last)
556  erase(_First++);
557  return (_Make_iter(_First));
558  }
559  }
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
void clear() _NOEXCEPT
Definition: xhash:569
iterator begin() _NOEXCEPT
Definition: xhash:277
iterator end() _NOEXCEPT
Definition: xhash:287
iterator erase(const_iterator _Plist)
Definition: xhash:537
_FwdIt _Last
Definition: algorithm:1936
template<class _Traits>
size_type _Hash< _Traits >::erase ( const key_type _Keyval)
inline
562  { // erase and count all that match _Keyval
563  _Pairii _Where = equal_range(_Keyval);
564  size_type _Num = _STD distance(_Where.first, _Where.second);
565  erase(_Where.first, _Where.second);
566  return (_Num);
567  }
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1124
_Pairii equal_range(const key_type &_Keyval)
Definition: xhash:635
pair< iterator, iterator > _Pairii
Definition: xhash:190
_Mylist::size_type size_type
Definition: xhash:166
iterator erase(const_iterator _Plist)
Definition: xhash:537
template<class _Traits>
iterator _Hash< _Traits >::find ( const key_type _Keyval)
inline
576  { // find an element in mutable hash table that matches _Keyval
577  return (lower_bound(_Keyval));
578  }
iterator lower_bound(const key_type &_Keyval)
Definition: xhash:591
template<class _Traits>
const_iterator _Hash< _Traits >::find ( const key_type _Keyval) const
inline
581  { // find an element in nonmutable hash table that matches _Keyval
582  return (lower_bound(_Keyval));
583  }
iterator lower_bound(const key_type &_Keyval)
Definition: xhash:591
template<class _Traits>
allocator_type _Hash< _Traits >::get_allocator ( ) const
inline
353  { // return allocator object for values
355  return (_Ret);
356  }
_Mylist::allocator_type allocator_type
Definition: xhash:165
_Mylist _List
Definition: xhash:911
allocator_type get_allocator() const _NOEXCEPT
Definition: list:1255
template<class _Traits>
template<bool _Multi2 = _Multi, enable_if_t<!_Multi2, int > = 0>
_Pairib _Hash< _Traits >::insert ( const value_type _Val)
inline
488  { // try to insert node with value _Val
489  return (_Insert(_Val, _Nil()));
490  }
_In_ int _Val
Definition: vcruntime_string.h:62
_Pairib _Insert(_Valty &&_Val, _Nodety _Pnode)
Definition: xhash:712
Definition: xtr1common:15
template<class _Traits>
template<bool _Multi2 = _Multi, enable_if_t< _Multi2, int > = 0>
iterator _Hash< _Traits >::insert ( const value_type _Val)
inline
495  { // try to insert node with value _Val
496  return (_Insert(_Val, _Nil()).first);
497  }
_In_ int _Val
Definition: vcruntime_string.h:62
_Pairib _Insert(_Valty &&_Val, _Nodety _Pnode)
Definition: xhash:712
Definition: xtr1common:15
template<class _Traits>
template<bool _Multi2 = _Multi, enable_if_t<!_Multi2, int > = 0>
_Pairib _Hash< _Traits >::insert ( value_type &&  _Val)
inline
502  { // try to insert node with value _Val, favoring right side
503  return (_Insert(_STD forward<value_type>(_Val), _Nil()));
504  }
_In_ int _Val
Definition: vcruntime_string.h:62
_Pairib _Insert(_Valty &&_Val, _Nodety _Pnode)
Definition: xhash:712
Definition: xtr1common:15
template<class _Traits>
template<bool _Multi2 = _Multi, enable_if_t< _Multi2, int > = 0>
iterator _Hash< _Traits >::insert ( value_type &&  _Val)
inline
509  { // try to insert node with value _Val, favoring right side
510  return (_Insert(_STD forward<value_type>(_Val), _Nil()).first);
511  }
_In_ int _Val
Definition: vcruntime_string.h:62
_Pairib _Insert(_Valty &&_Val, _Nodety _Pnode)
Definition: xhash:712
Definition: xtr1common:15
template<class _Traits>
iterator _Hash< _Traits >::insert ( const_iterator  ,
const value_type _Val 
)
inline
515  { // try to insert node with value _Val, ignore hint
516  return (_Insert(_Val, _Nil()).first);
517  }
_In_ int _Val
Definition: vcruntime_string.h:62
_Pairib _Insert(_Valty &&_Val, _Nodety _Pnode)
Definition: xhash:712
Definition: xtr1common:15
template<class _Traits>
iterator _Hash< _Traits >::insert ( const_iterator  ,
value_type &&  _Val 
)
inline
520  { // try to insert node with value _Val, ignore hint
521  return (_Insert(_STD forward<value_type>(_Val), _Nil()).first);
522  }
_In_ int _Val
Definition: vcruntime_string.h:62
_Pairib _Insert(_Valty &&_Val, _Nodety _Pnode)
Definition: xhash:712
Definition: xtr1common:15
template<class _Traits>
template<class _Iter >
void _Hash< _Traits >::insert ( _Iter  _First,
_Iter  _Last 
)
inline
526  { // insert [_First, _Last) at front, then put in place
527  _DEBUG_RANGE(_First, _Last);
528  for (; _First != _Last; ++_First)
529  emplace(*_First);
530  }
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_Pairib emplace(_Valty &&..._Val)
Definition: xhash:252
_FwdIt _Last
Definition: algorithm:1936
template<class _Traits>
void _Hash< _Traits >::insert ( _XSTD initializer_list< value_type _Ilist)
inline
533  { // insert initializer_list
534  insert(_Ilist.begin(), _Ilist.end());
535  }
_Pairib insert(const value_type &_Val)
Definition: xhash:487
template<class _Traits>
key_compare _Hash< _Traits >::key_comp ( ) const
inline
359  { // return object for comparing keys
360  return (_Traitsobj);
361  }
_Traits _Traitsobj
Definition: xhash:910
template<class _Traits>
float _Hash< _Traits >::load_factor ( ) const
inline
445  { // return elements per bucket
446  return ((float)size() / (float)bucket_count());
447  }
size_type size() const _NOEXCEPT
Definition: xhash:337
size_type bucket_count() const _NOEXCEPT
Definition: xhash:371
template<class _Traits>
iterator _Hash< _Traits >::lower_bound ( const key_type _Keyval)
inline
592  { // find leftmost not less than _Keyval in mutable hash table
593  size_type _Bucket = _Hashval(_Keyval);
594  for (_Unchecked_iterator _Where = _Begin(_Bucket);
595  _Where != _End(_Bucket); ++_Where)
596  if (!_Traitsobj(_Traits::_Kfn(*_Where), _Keyval))
597  return (_Traitsobj(_Keyval,
598  _Traits::_Kfn(*_Where)) ? end() : _Make_iter(_Where));
599  return (end());
600  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
_Unchecked_iterator _End(size_type _Bucket)
Definition: xhash:791
iterator end() _NOEXCEPT
Definition: xhash:287
_Traits _Traitsobj
Definition: xhash:910
_Mylist::size_type size_type
Definition: xhash:166
_Unchecked_iterator _Begin(size_type _Bucket)
Definition: xhash:781
size_type _Hashval(const key_type &_Keyval) const
Definition: xhash:857
_If< is_same< key_type, value_type >::value, typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator >::type _Unchecked_iterator
Definition: xhash:181
template<class _Traits>
const_iterator _Hash< _Traits >::lower_bound ( const key_type _Keyval) const
inline
603  { // find leftmost not less than _Keyval in nonmutable hash table
604  size_type _Bucket = _Hashval(_Keyval);
605  for (_Unchecked_const_iterator _Where = _Begin(_Bucket);
606  _Where != _End(_Bucket); ++_Where)
607  if (!_Traitsobj(_Traits::_Kfn(*_Where), _Keyval))
608  return (_Traitsobj(_Keyval,
609  _Traits::_Kfn(*_Where)) ? end() : _Make_iter(_Where));
610  return (end());
611  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
_Mylist::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: xhash:183
_Unchecked_iterator _End(size_type _Bucket)
Definition: xhash:791
iterator end() _NOEXCEPT
Definition: xhash:287
_Traits _Traitsobj
Definition: xhash:910
_Mylist::size_type size_type
Definition: xhash:166
_Unchecked_iterator _Begin(size_type _Bucket)
Definition: xhash:781
size_type _Hashval(const key_type &_Keyval) const
Definition: xhash:857
template<class _Traits>
size_type _Hash< _Traits >::max_bucket_count ( ) const
inline
377  { // return maximum number of buckets
378  return (_Vec.max_size() / 2);
379  }
size_type max_size() const _NOEXCEPT
Definition: vector:1183
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
float _Hash< _Traits >::max_load_factor ( ) const
inline
450  { // return maximum elements per bucket
451  return (_Max_bucket_size());
452  }
float & _Max_bucket_size() _NOEXCEPT
Definition: xhash:900
template<class _Traits>
void _Hash< _Traits >::max_load_factor ( float  _Newmax)
inline
455  { // set new load factor
456  if (_Newmax != _Newmax // may detect a NaN
457  || _Newmax < 0)
458  _Xout_of_range("invalid hash load factor");
459 
460  _Max_bucket_size() = _Newmax;
461  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
float & _Max_bucket_size() _NOEXCEPT
Definition: xhash:900
template<class _Traits>
size_type _Hash< _Traits >::max_size ( ) const
inline
343  { // return maximum possible length of sequence
344  return (_List.max_size());
345  }
_Mylist _List
Definition: xhash:911
size_type max_size() const _NOEXCEPT
Definition: list:1245
template<class _Traits>
_Myt& _Hash< _Traits >::operator= ( _Myt &&  _Right)
inline
239  { // assign by moving _Right
240  if (this != &_Right)
241  _Assign_rv(_STD forward<_Myt>(_Right));
242  return (*this);
243  }
void _Assign_rv(_Myt &&_Right)
Definition: xhash:245
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Traits>
_Myt& _Hash< _Traits >::operator= ( const _Myt _Right)
inline
271  { // replace contents from _Right
272  if (this != &_Right)
273  _Copy(_Right);
274  return (*this);
275  }
void _Copy(const _Myt &_Right)
Definition: xhash:841
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Traits>
void _Hash< _Traits >::rehash ( size_type  _Buckets)
inline
464  { // rebuild table with at least _Buckets buckets
466  size_type _Newsize = _Min_buckets;
467 
468  for (; _Newsize < _Buckets && _Newsize < _Maxsize; )
469  _Newsize *= 2; // double until big enough
470  if (_Newsize < _Buckets)
471  _Xout_of_range("invalid hash bucket count");
472  while (!(size() / max_load_factor() < _Newsize)
473  && _Newsize < _Maxsize)
474  _Newsize *= 2; // double until load factor okay
475 
476  _Init(_Newsize);
477  _Reinsert();
478  }
Definition: xhash:158
size_type size() const _NOEXCEPT
Definition: xhash:337
size_type max_size() const _NOEXCEPT
Definition: vector:1183
_In_ size_t _Maxsize
Definition: xlocinfo.h:145
void _Reinsert()
Definition: xhash:886
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
_Mylist::size_type size_type
Definition: xhash:166
float max_load_factor() const _NOEXCEPT
Definition: xhash:449
void _Init(size_type _Buckets=_Min_buckets)
Definition: xhash:862
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
void _Hash< _Traits >::reserve ( size_type  _Maxcount)
inline
481  { // rebuild table with room for _Maxcount elements
482  rehash((size_type)((float)(_Maxcount / max_load_factor() + 0.5F)));
483  }
_Mylist::size_type size_type
Definition: xhash:166
float max_load_factor() const _NOEXCEPT
Definition: xhash:449
void rehash(size_type _Buckets)
Definition: xhash:463
template<class _Traits>
size_type _Hash< _Traits >::size ( ) const
inline
338  { // return length of sequence
339  return (_List.size());
340  }
_Mylist _List
Definition: xhash:911
size_type size() const _NOEXCEPT
Definition: list:1240
template<class _Traits>
void _Hash< _Traits >::swap ( _Myt _Right)
inline
674  { // exchange contents with _Right
675  if (this != &_Right)
676  { // different, worth swapping
677  _Swap_adl(_Traitsobj, _Right._Traitsobj);
678 
679  this->_List.swap(_Right._List);
680  this->_Vec.swap(_Right._Vec);
681  _Swap_adl(this->_Mask, _Right._Mask);
682  _Swap_adl(this->_Maxidx, _Right._Maxidx);
683  }
684  }
size_type _Mask
Definition: xhash:913
void swap(_Myt &_Right) _NOEXCEPT_OP(_Alty
Definition: vector:1545
_Mylist _List
Definition: xhash:911
size_type _Maxidx
Definition: xhash:914
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:56
_Traits _Traitsobj
Definition: xhash:910
void swap(_Myt &_Right) _NOEXCEPT_OP(_Alty
Definition: list:1517
constexpr const _Ty &() _Right
Definition: algorithm:3591
_Myvec _Vec
Definition: xhash:912
template<class _Traits>
iterator _Hash< _Traits >::upper_bound ( const key_type _Keyval)
inline
614  { // find leftmost not greater than _Keyval in mutable hash table
615  size_type _Bucket = _Hashval(_Keyval);
616  for (_Unchecked_iterator _Where = _End(_Bucket);
617  _Where != _Begin(_Bucket); )
618  if (!_Traitsobj(_Keyval, _Traits::_Kfn(*--_Where)))
619  return (_Traitsobj(_Traits::_Kfn(*_Where),
620  _Keyval) ? end() : _Make_iter(++_Where));
621  return (end());
622  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
_Unchecked_iterator _End(size_type _Bucket)
Definition: xhash:791
iterator end() _NOEXCEPT
Definition: xhash:287
_Traits _Traitsobj
Definition: xhash:910
_Mylist::size_type size_type
Definition: xhash:166
_Unchecked_iterator _Begin(size_type _Bucket)
Definition: xhash:781
size_type _Hashval(const key_type &_Keyval) const
Definition: xhash:857
_If< is_same< key_type, value_type >::value, typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator >::type _Unchecked_iterator
Definition: xhash:181
template<class _Traits>
const_iterator _Hash< _Traits >::upper_bound ( const key_type _Keyval) const
inline
625  { // find leftmost not greater than _Keyval in nonmutable hash table
626  size_type _Bucket = _Hashval(_Keyval);
627  for (_Unchecked_const_iterator _Where = _End(_Bucket);
628  _Where != _Begin(_Bucket); )
629  if (!_Traitsobj(_Keyval, _Traits::_Kfn(*--_Where)))
630  return (_Traitsobj(_Traits::_Kfn(*_Where),
631  _Keyval) ? end() : _Make_iter(++_Where));
632  return (end());
633  }
iterator _Make_iter(_Unchecked_const_iterator _Where) const
Definition: xhash:317
_Mylist::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: xhash:183
_Unchecked_iterator _End(size_type _Bucket)
Definition: xhash:791
iterator end() _NOEXCEPT
Definition: xhash:287
_Traits _Traitsobj
Definition: xhash:910
_Mylist::size_type size_type
Definition: xhash:166
_Unchecked_iterator _Begin(size_type _Bucket)
Definition: xhash:781
size_type _Hashval(const key_type &_Keyval) const
Definition: xhash:857
template<class _Traits>
value_compare _Hash< _Traits >::value_comp ( ) const
inline
364  { // return object for comparing values
365  return (value_compare(key_comp()));
366  }
key_compare key_comp() const
Definition: xhash:358
_Traits::value_compare value_compare
Definition: xhash:154

Member Data Documentation

template<class _Traits>
_Mylist _Hash< _Traits >::_List
protected
template<class _Traits>
size_type _Hash< _Traits >::_Mask
protected
template<class _Traits>
size_type _Hash< _Traits >::_Maxidx
protected
template<class _Traits>
_Traits _Hash< _Traits >::_Traitsobj
protected
template<class _Traits>
_Myvec _Hash< _Traits >::_Vec
protected

The documentation for this class was generated from the following file: