Files
hashmap-bench/src/includes/prepare.h
2020-02-07 13:17:30 -03:00

52 lines
1.5 KiB
C++

#ifndef PREPARE_H
#define PREPARE_H
#include <string>
// hashmaps and hash
#include <unordered_map>
#include "3thparty/sparsehash/sparse_hash_map"
#include "3thparty/sparsehash/dense_hash_map"
#include "./3thparty/abseil-cpp/absl/container/node_hash_map.h"
#include "./3thparty/abseil-cpp/absl/container/flat_hash_map.h"
#include "./3thparty/abseil-cpp/absl/hash/hash.h"
#include "./3thparty/tsl/sparse_map.h"
#include "./3thparty/tsl/array_map.h"
#include "./3thparty/tsl/ordered_map.h"
#include "./3thparty/tsl/robin_map.h"
#include "./3thparty/tsl/hopscotch_map.h"
#include <boost/unordered_map.hpp>
#include "./3thparty/skarupke/bytell_hash_map.hpp"
#include "./3thparty/skarupke/flat_hash_map.hpp"
#include "./3thparty/skarupke/unordered_map.hpp"
#include "./3thparty/parallel_hashmap/phmap.h"
#include "./3thparty/emilib/hash_map.hpp"
#include "3thparty/robinhood/robin_hood.h"
#include <type_traits>
using std::string;
using absl::Hash;
template<class T>
void prepare(T& map, int size){
map.reserve(size);
}
void prepare(google::sparse_hash_map<int, int>& map, int size){
map.set_deleted_key(-1);
}
void prepare(google::sparse_hash_map<string, string>& map, int size){
map.set_deleted_key("a");
}
void prepare(google::dense_hash_map<int, int>& map, int size){
map.set_empty_key(0);
map.set_deleted_key(-1);
}
void prepare(google::dense_hash_map<string, string>& map, int size){
map.set_deleted_key("a");
map.set_empty_key("");
}
#endif /* TESTS_H */