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_compare< _Kty, _Pr >
 
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
1014  { // test for _Hash equality
1015  return (_Left.size() == _Right.size() && _Hash_equal_elements(
1016  _Left, _Right, integral_constant<bool, _Traits::_Multi>()));
1017  }
Definition: xtr1common:23
size_type size() const _NOEXCEPT
Definition: xhash:385
bool _Hash_equal_elements(const _Hash< _Traits > &_Left, const _Hash< _Traits > &_Right, false_type)
Definition: xhash:972
template<class _Traits >
bool _Hash_equal_elements ( const _Hash< _Traits > &  _Left,
const _Hash< _Traits > &  _Right,
false_type   
)
inline
976  { // test for _Hash equality (same size, unique keys)
977  typedef typename _Hash<_Traits>::const_iterator _Iter;
978  for (_Iter _Next1 = _Left.begin(); _Next1 != _Left.end(); ++_Next1)
979  { // look for element with equivalent key
980  _Iter _Next2 = _Right.find(_Traits::_Kfn(*_Next1));
981  if (_Next2 == _Right.end()
982  || !(_Traits::_Nonkfn(*_Next1) == _Traits::_Nonkfn(*_Next2)))
983  return (false);
984  }
985  return (true);
986  }
iterator find(const key_type &_Keyval)
Definition: xhash:623
iterator begin() _NOEXCEPT
Definition: xhash:325
iterator end() _NOEXCEPT
Definition: xhash:335
Definition: list:166
template<class _Traits >
bool _Hash_equal_elements ( const _Hash< _Traits > &  _Left,
const _Hash< _Traits > &  _Right,
true_type   
)
inline
993  { // test for _Hash equality (same size, equivalent keys)
994  typedef typename _Hash<_Traits>::const_iterator _Iter;
995  typedef pair<_Iter, _Iter> _Iter_pair;
996 
997  for (_Iter _Next1 = _Left.begin(); _Next1 != _Left.end(); )
998  { // look for elements with equivalent keys
999  _Iter_pair _Lrange = _Left.equal_range(_Traits::_Kfn(*_Next1));
1000  _Iter_pair _Rrange = _Right.equal_range(_Traits::_Kfn(*_Next1));
1001 
1002  if (!_STD is_permutation(_Lrange.first, _Lrange.second,
1003  _Rrange.first, _Rrange.second))
1004  return (false);
1005  _Next1 = _Lrange.second; // continue just past range
1006  }
1007  return (true);
1008  }
_Ty2 second
Definition: utility:271
_Pairii equal_range(const key_type &_Keyval)
Definition: xhash:683
iterator begin() _NOEXCEPT
Definition: xhash:325
bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Pr _Pred)
Definition: xutility:3323
iterator end() _NOEXCEPT
Definition: xhash:335
Definition: utility:92
Definition: list:166