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 
60  { // parameters for hash table
61  bucket_size = 1 // 0 < bucket_size
62  };

Constructor & Destructor Documentation

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

Member Function Documentation

template<class _Kty , class _Pr = less<_Kty>>
size_t stdext::hash_compare< _Kty, _Pr >::operator() ( const _Kty &  _Keyval) const
inline
70  { // hash _Keyval to size_t value by pseudorandomizing transform
71  long _Quot = (long)(hash_value(_Keyval) & LONG_MAX);
72  ldiv_t _Qrem = _CSTD ldiv(_Quot, 127773);
73 
74  _Qrem.rem = 16807 * _Qrem.rem - 2836 * _Qrem.quot;
75  if (_Qrem.rem < 0)
76  _Qrem.rem += LONG_MAX;
77  return ((size_t)_Qrem.rem);
78  }
size_t hash_value(const _Kty &_Keyval)
Definition: xhash:27
#define LONG_MAX
Definition: limits.h:38
#define _CSTD
Definition: yvals.h:570
template<class _Kty , class _Pr = less<_Kty>>
bool stdext::hash_compare< _Kty, _Pr >::operator() ( const _Kty &  _Keyval1,
const _Kty &  _Keyval2 
) const
inline
81  { // test if _Keyval1 ordered before _Keyval2
82  return (comp(_Keyval1, _Keyval2));
83  }
_Pr comp
Definition: xhash:85

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: