29 lines
531 B
Plaintext
29 lines
531 B
Plaintext
#ifndef HASH_MAP_H
|
|
#define HASH_MAP_H
|
|
// wrapper for Objectspace hash map...
|
|
#include <hashmap.h>
|
|
|
|
#ifndef HASHCHARSTAR_H
|
|
#define HASHCHARSTAR_H
|
|
inline size_t __stl_hash_string(const char* s)
|
|
{
|
|
unsigned long h = 0;
|
|
for ( ; *s; ++s)
|
|
h = 5*h + *s;
|
|
|
|
return size_t(h);
|
|
}
|
|
struct hash<const char*>
|
|
{
|
|
size_t operator()(const char* s) const { return __stl_hash_string(s); }
|
|
};
|
|
|
|
struct hash<char*>
|
|
{
|
|
size_t operator()(const char* s) const { return __stl_hash_string(s); }
|
|
};
|
|
|
|
#endif // HASHCHARSTAR_H
|
|
|
|
#endif // HASH_MAP_H
|