Switching Hashtable from google sparsehash to boost::unordered_map

This commit is contained in:
DennisOSRM 2011-10-04 10:28:40 +02:00
parent d1b723e5e1
commit 482edd0b02

View File

@ -24,25 +24,13 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef HASHTABLE_H_ #ifndef HASHTABLE_H_
#define HASHTABLE_H_ #define HASHTABLE_H_
#include <google/sparse_hash_map> #include <boost/unordered_map.hpp>
#include <string>
#include <ext/hash_map>
namespace __gnu_cxx
{
template<> struct hash<std::string> {
size_t operator()(const std::string& x) const {
return hash<const char*>()(x.c_str());
}
};
}
template<typename keyT, typename valueT> template<typename keyT, typename valueT>
class HashTable { class HashTable {
typedef google::sparse_hash_map<keyT, valueT> MyHashTable; typedef boost::unordered_map<keyT, valueT> MyHashTable;
public: public:
typedef typename google::sparse_hash_map<keyT, valueT>::const_iterator MyIterator; typedef typename boost::unordered_map<keyT, valueT>::const_iterator MyIterator;
typedef MyIterator iterator; typedef MyIterator iterator;
HashTable() { } HashTable() { }
HashTable(const unsigned size) { HashTable(const unsigned size) {