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

Public Types

enum  { bucket_size = 1 }
 

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 Attributes

_Pr comp
 

Member Enumeration Documentation

template<class _Kty , class _Pr = less<_Kty>>
anonymous enum
Enumerator
bucket_size 
59  { // parameters for hash table
60  bucket_size = 1 // 0 < bucket_size
61  };

Constructor & Destructor Documentation

template<class _Kty , class _Pr = less<_Kty>>
stdext::hash_compare< _Kty, _Pr >::hash_compare ( _Pr  _Pred = _Pr())
inline
64  : comp(_Pred)
65  { // construct with _Pred comparator
66  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
_Pr comp
Definition: xhash:84

Member Function Documentation

template<class _Kty , class _Pr = less<_Kty>>
size_t stdext::hash_compare< _Kty, _Pr >::operator() ( const _Kty &  _Keyval) const
inline
69  { // hash _Keyval to size_t value by pseudorandomizing transform
70  long _Quot = (long)(hash_value(_Keyval) & LONG_MAX);
71  ldiv_t _Qrem = _CSTD ldiv(_Quot, 127773);
72 
73  _Qrem.rem = 16807 * _Qrem.rem - 2836 * _Qrem.quot;
74  if (_Qrem.rem < 0)
75  _Qrem.rem += LONG_MAX;
76  return ((size_t)_Qrem.rem);
77  }
_In_ long
Definition: corecrt_wstdlib.h:88
long quot
Definition: stdlib.h:278
Definition: stdlib.h:276
size_t hash_value(const _Kty &_Keyval)
Definition: xhash:26
long rem
Definition: stdlib.h:279
#define LONG_MAX
Definition: limits.h:38
#define _CSTD
Definition: yvals.h:570
_Check_return_ _ACRTIMP ldiv_t __cdecl ldiv(_In_ long _Numerator, _In_ long _Denominator)
template<class _Kty , class _Pr = less<_Kty>>
bool stdext::hash_compare< _Kty, _Pr >::operator() ( const _Kty &  _Keyval1,
const _Kty &  _Keyval2 
) const
inline
80  { // test if _Keyval1 ordered before _Keyval2
81  return (comp(_Keyval1, _Keyval2));
82  }
_Pr comp
Definition: xhash:84

Member Data Documentation

template<class _Kty , class _Pr = less<_Kty>>
_Pr stdext::hash_compare< _Kty, _Pr >::comp

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