aboutsummaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index 7659322..8e65a07 100644
--- a/src/common.h
+++ b/src/common.h
@@ -1,5 +1,6 @@
#pragma once
+#include "wyhash.h"
#include <iostream>
#include <stdlib.h>
#include <string.h>
@@ -99,6 +100,13 @@ struct line_view {
}
};
+namespace std {
+template <>
+struct hash<line_view> {
+ size_t operator()(const line_view& lv) const noexcept { return wyhash(lv.line, lv.length, 0, _wyp); }
+};
+} // namespace std
+
line_view load_file(const char*);
line_view next_line(line_view, size_t*);