TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
google::protobuf::hash< pair< First, Second > > Struct Template Reference

#include <hash.h>

Public Member Functions

size_t operator() (const pair< First, Second > &key) const
 
size_t operator() (const pair< First, Second > &a, const pair< First, Second > &b) const
 
size_t operator() (const pair< First, Second > &key) const
 
size_t operator() (const pair< First, Second > &a, const pair< First, Second > &b) const
 

Static Public Attributes

static const size_t bucket_size = 4
 
static const size_t min_buckets = 8
 

Member Function Documentation

template<typename First , typename Second >
size_t google::protobuf::hash< pair< First, Second > >::operator() ( const pair< First, Second > &  key) const
inline
204  {
205  size_t first_hash = hash<First>()(key.first);
206  size_t second_hash = hash<Second>()(key.second);
207 
208  // FIXME(kenton): What is the best way to compute this hash? I have
209  // no idea! This seems a bit better than an XOR.
210  return first_hash * ((1 << 16) - 1) + second_hash;
211  }
template<typename First , typename Second >
size_t google::protobuf::hash< pair< First, Second > >::operator() ( const pair< First, Second > &  key) const
inline
204  {
205  size_t first_hash = hash<First>()(key.first);
206  size_t second_hash = hash<Second>()(key.second);
207 
208  // FIXME(kenton): What is the best way to compute this hash? I have
209  // no idea! This seems a bit better than an XOR.
210  return first_hash * ((1 << 16) - 1) + second_hash;
211  }
template<typename First , typename Second >
size_t google::protobuf::hash< pair< First, Second > >::operator() ( const pair< First, Second > &  a,
const pair< First, Second > &  b 
) const
inline
216  {
217  return a < b;
218  }
template<typename First , typename Second >
size_t google::protobuf::hash< pair< First, Second > >::operator() ( const pair< First, Second > &  a,
const pair< First, Second > &  b 
) const
inline
216  {
217  return a < b;
218  }

Member Data Documentation

template<typename First , typename Second >
static const size_t google::protobuf::hash< pair< First, Second > >::bucket_size = 4
static
template<typename First , typename Second >
static const size_t google::protobuf::hash< pair< First, Second > >::min_buckets = 8
static

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