STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | List of all members
stdext::hash_compare< _Kty, _Pr > Class Template Reference
Inheritance diagram for stdext::hash_compare< _Kty, _Pr >:
stdext::_Hash_pr<!is_empty< _Pr >::value, _Kty, _Pr >

Public Types

enum  { bucket_size = 1 }
 
typedef _Hash_pr<!is_empty< _Pr >::value, _Kty, _Pr > _Mybase
 

Public Member Functions

 hash_compare (_Pr _Pred=_Pr())
 
size_t operator() (const _Kty &_Keyval) const
 
bool operator() (const _Kty &_Keyval1, const _Kty &_Keyval2) const
 
- Public Member Functions inherited from stdext::_Hash_pr<!is_empty< _Pr >::value, _Kty, _Pr >
 _Hash_pr (_Pr _Pred)
 
const _Pr & _Getcomp () const
 

Additional Inherited Members

- Public Attributes inherited from stdext::_Hash_pr<!is_empty< _Pr >::value, _Kty, _Pr >
_Pr comp
 

Member Typedef Documentation

template<class _Kty , class _Pr = less<_Kty>>
typedef _Hash_pr<!is_empty<_Pr>::value, _Kty, _Pr> stdext::hash_compare< _Kty, _Pr >::_Mybase

Member Enumeration Documentation

template<class _Kty , class _Pr = less<_Kty>>
anonymous enum
Enumerator
bucket_size 
100  { // parameters for hash table
101  bucket_size = 1 // 0 < bucket_size
102  };

Constructor & Destructor Documentation

template<class _Kty , class _Pr = less<_Kty>>
stdext::hash_compare< _Kty, _Pr >::hash_compare ( _Pr  _Pred = _Pr())
inline
105  : _Mybase(_Pred)
106  { // construct with _Pred comparator
107  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
_Hash_pr<!is_empty< _Pr >::value, _Kty, _Pr > _Mybase
Definition: xhash:98

Member Function Documentation

template<class _Kty , class _Pr = less<_Kty>>
size_t stdext::hash_compare< _Kty, _Pr >::operator() ( const _Kty &  _Keyval) const
inline
110  { // hash _Keyval to size_t value by pseudorandomizing transform
111  long _Quot = (long)(hash_value(_Keyval) & LONG_MAX);
112  ldiv_t _Qrem = _CSTD ldiv(_Quot, 127773);
113 
114  _Qrem.rem = 16807 * _Qrem.rem - 2836 * _Qrem.quot;
115  if (_Qrem.rem < 0)
116  _Qrem.rem += LONG_MAX;
117  return ((size_t)_Qrem.rem);
118  }
long quot
Definition: stdlib.h:81
Definition: stdlib.h:80
size_t hash_value(const _Kty &_Keyval)
Definition: xhash:28
long rem
Definition: stdlib.h:82
_Check_return_ _CRTIMP ldiv_t __cdecl ldiv(_In_ long _Numerator, _In_ long _Denominator)
#define LONG_MAX
Definition: limits.h:43
#define _CSTD
Definition: yvals.h:559
template<class _Kty , class _Pr = less<_Kty>>
bool stdext::hash_compare< _Kty, _Pr >::operator() ( const _Kty &  _Keyval1,
const _Kty &  _Keyval2 
) const
inline
121  { // test if _Keyval1 ordered before _Keyval2
122  return (this->_Getcomp()(_Keyval1, _Keyval2));
123  }
const _Pr & _Getcomp() const
Definition: xhash:66

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