STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Macros | Functions
xhash File Reference
#include <cstring>
#include <cwchar>
#include <list>
#include <vector>

Classes

class  stdext::_Hash_pr< _Comp_has_storage, _Kty, _Pr >
 
class  stdext::_Hash_pr< false, _Kty, _Pr >
 
class  stdext::hash_compare< _Kty, _Pr >
 
class  _Hash_oper1< _Hasher_has_storage, _Hasher >
 
class  _Hash_oper1< false, _Hasher >
 
class  _Hash_oper2< _Comparator_has_storage, _Hasher, _Keyeq >
 
class  _Hash_oper2< false, _Hasher, _Keyeq >
 
class  _Uhash_compare< _Kty, _Hasher, _Keyeq >
 
class  _Hash< _Traits >
 

Namespaces

 stdext
 

Macros

#define _XHASH_
 
#define _HASH_SEED   (size_t)0xdeadbeef
 

Functions

template<class _Kty >
size_t stdext::hash_value (const _Kty &_Keyval)
 
template<class _Elem , class _Traits , class _Alloc >
size_t stdext::hash_value (const basic_string< _Elem, _Traits, _Alloc > &_Str)
 
size_t stdext::hash_value (_In_z_ const char *_Str)
 
size_t stdext::hash_value (_In_z_ const wchar_t *_Str)
 
template<class _Traits >
bool _Hash_equal_elements (const _Hash< _Traits > &_Left, const _Hash< _Traits > &_Right, false_type)
 
template<class _Traits >
bool _Hash_equal_elements (const _Hash< _Traits > &_Left, const _Hash< _Traits > &_Right, true_type)
 
template<class _Traits >
bool _Hash_equal (const _Hash< _Traits > &_Left, const _Hash< _Traits > &_Right)
 

Macro Definition Documentation

#define _HASH_SEED   (size_t)0xdeadbeef
#define _XHASH_

Function Documentation

template<class _Traits >
bool _Hash_equal ( const _Hash< _Traits > &  _Left,
const _Hash< _Traits > &  _Right 
)
inline
1094  { // test for _Hash equality
1095  return (_Left.size() == _Right.size() && _Hash_equal_elements(
1096  _Left, _Right, integral_constant<bool, _Traits::_Multi>()));
1097  }
Definition: xtr1common:34
size_type size() const _NOEXCEPT
Definition: xhash:508
bool _Hash_equal_elements(const _Hash< _Traits > &_Left, const _Hash< _Traits > &_Right, false_type)
Definition: xhash:1050
template<class _Traits >
bool _Hash_equal_elements ( const _Hash< _Traits > &  _Left,
const _Hash< _Traits > &  _Right,
false_type   
)
inline
1054  { // test for _Hash equality (same size, unique keys)
1055  typedef typename _Hash<_Traits>::const_iterator _Iter;
1056  for (_Iter _Next1 = _Left.begin(); _Next1 != _Left.end(); ++_Next1)
1057  { // look for element with equivalent key
1058  _Iter _Next2 = _Right.find(_Left._Kfn(*_Next1));
1059  if (_Next2 == _Right.end()
1060  || !(_Left._Nonkfn(*_Next1) == _Right._Nonkfn(*_Next2)))
1061  return (false);
1062  }
1063  return (true);
1064  }
iterator find(const key_type &_Keyval)
Definition: xhash:721
iterator begin() _NOEXCEPT
Definition: xhash:418
iterator end() _NOEXCEPT
Definition: xhash:428
Definition: list:166
template<class _Traits >
bool _Hash_equal_elements ( const _Hash< _Traits > &  _Left,
const _Hash< _Traits > &  _Right,
true_type   
)
inline
1071  { // test for _Hash equality (same size, equivalent keys)
1072  typedef typename _Hash<_Traits>::const_iterator _Iter;
1073  typedef pair<_Iter, _Iter> _Iter_pair;
1074 
1075  for (_Iter _Next1 = _Left.begin(); _Next1 != _Left.end(); )
1076  { // look for elements with equivalent keys
1077  _Iter_pair _Lrange = _Left.equal_range(_Left._Kfn(*_Next1));
1078  _Iter_pair _Rrange = _Right.equal_range(_Left._Kfn(*_Next1));
1079 
1080  if (distance(_Lrange.first, _Lrange.second)
1081  != distance(_Rrange.first, _Rrange.second)
1082  || !is_permutation(_Lrange.first, _Lrange.second,
1083  _Rrange.first))
1084  return (false);
1085  _Next1 = _Lrange.second; // continue just past range
1086  }
1087  return (true);
1088  }
iterator_traits< _InIt >::difference_type distance(_InIt _First, _InIt _Last)
Definition: xutility:755
_Pairii equal_range(const key_type &_Keyval)
Definition: xhash:783
iterator begin() _NOEXCEPT
Definition: xhash:418
bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Pr _Pred)
Definition: xutility:3137
iterator end() _NOEXCEPT
Definition: xhash:428
Definition: utility:80
second
Definition: utility:167
Definition: list:166