Still need a better way identify left/right sidedness
This commit is contained in:
16
Internal.h
16
Internal.h
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <bit>
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
@@ -184,9 +185,20 @@ template <class T> using Set = std::set<T, std::less<T>, ArenaAlloc<T>>;
|
||||
template <class T> auto set(Arena &arena) {
|
||||
return Set<T>(ArenaAlloc<T>(&arena));
|
||||
}
|
||||
|
||||
template <class T> struct MyHash;
|
||||
|
||||
template <class T> struct MyHash<T *> {
|
||||
size_t operator()(const T *t) const noexcept {
|
||||
size_t result;
|
||||
memcpy(&result, &t, sizeof(result));
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <class T>
|
||||
using HashSet =
|
||||
std::unordered_set<T, std::hash<T>, std::equal_to<T>, ArenaAlloc<T>>;
|
||||
std::unordered_set<T, MyHash<T>, std::equal_to<T>, ArenaAlloc<T>>;
|
||||
template <class T> auto hashSet(Arena &arena) {
|
||||
return HashSet<T>(ArenaAlloc<T>(&arena));
|
||||
}
|
||||
@@ -449,7 +461,7 @@ template <class ConflictSetImpl> struct TestDriver {
|
||||
ConflictSetImpl cs{writeVersion};
|
||||
ReferenceImpl refImpl{writeVersion};
|
||||
|
||||
constexpr static auto kMaxKeyLen = 24;
|
||||
constexpr static auto kMaxKeyLen = 32;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
|
Reference in New Issue
Block a user