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
961  { // test for _Hash equality
962  return (_Left.size() == _Right.size() && _Hash_equal_elements(
963  _Left, _Right, integral_constant<bool, _Traits::_Multi>()));
964  }
Definition: xtr1common:22
size_type size() const _NOEXCEPT
Definition: xhash:337
bool _Hash_equal_elements(const _Hash< _Traits > &_Left, const _Hash< _Traits > &_Right, false_type)
Definition: xhash:919
template<class _Traits >
bool _Hash_equal_elements ( const _Hash< _Traits > &  _Left,
const _Hash< _Traits > &  _Right,
false_type   
)
inline
923  { // test for _Hash equality (same size, unique keys)
924  typedef typename _Hash<_Traits>::const_iterator _Iter;
925  for (_Iter _Next1 = _Left.begin(); _Next1 != _Left.end(); ++_Next1)
926  { // look for element with equivalent key
927  _Iter _Next2 = _Right.find(_Traits::_Kfn(*_Next1));
928  if (_Next2 == _Right.end()
929  || !(_Traits::_Nonkfn(*_Next1) == _Traits::_Nonkfn(*_Next2)))
930  return (false);
931  }
932  return (true);
933  }
iterator find(const key_type &_Keyval)
Definition: xhash:575
iterator begin() _NOEXCEPT
Definition: xhash:277
iterator end() _NOEXCEPT
Definition: xhash:287
Definition: list:166
template<class _Traits >
bool _Hash_equal_elements ( const _Hash< _Traits > &  _Left,
const _Hash< _Traits > &  _Right,
true_type   
)
inline
940  { // test for _Hash equality (same size, equivalent keys)
941  typedef typename _Hash<_Traits>::const_iterator _Iter;
942  typedef pair<_Iter, _Iter> _Iter_pair;
943 
944  for (_Iter _Next1 = _Left.begin(); _Next1 != _Left.end(); )
945  { // look for elements with equivalent keys
946  _Iter_pair _Lrange = _Left.equal_range(_Traits::_Kfn(*_Next1));
947  _Iter_pair _Rrange = _Right.equal_range(_Traits::_Kfn(*_Next1));
948 
949  if (!_STD is_permutation(_Lrange.first, _Lrange.second,
950  _Rrange.first, _Rrange.second))
951  return (false);
952  _Next1 = _Lrange.second; // continue just past range
953  }
954  return (true);
955  }
_Ty2 second
Definition: utility:243
_Pairii equal_range(const key_type &_Keyval)
Definition: xhash:635
iterator begin() _NOEXCEPT
Definition: xhash:277
bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Pr _Pred)
Definition: xutility:3438
iterator end() _NOEXCEPT
Definition: xhash:287
Definition: utility:75
Definition: list:166