33 #ifndef GOOGLE_PROTOBUF_STUBS_HASH_H__
34 #define GOOGLE_PROTOBUF_STUBS_HASH_H__
38 #include <unordered_map>
39 #include <unordered_set>
41 # define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_START \
44 # define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_END }}
49 template <
typename Key>
52 template <
typename Key>
55 return reinterpret_cast<size_t>(
key);
65 for (; *
str !=
'\0';
str++) {
75 return static_cast<size_t>(
x);
85 static const size_t bucket_size = 4;
86 static const size_t min_buckets = 8;
92 template <
typename First,
typename Second>
100 return first_hash * ((1 << 16) - 1) + second_hash;
103 static const size_t bucket_size = 4;
104 static const size_t min_buckets = 8;
106 const std::pair<First, Second>&
b)
const {
114 #endif // GOOGLE_PROTOBUF_STUBS_HASH_H__