summaryrefslogtreecommitdiff
path: root/src/unordered_map.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-12-16 18:57:19 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-12-16 18:57:19 +0000
commitebecd60eb810246cfa682a1fbd72270aa9861f0b (patch)
tree0c5c707b68cb08fc93ace2433291deb8a52db5bc /src/unordered_map.hh
parentdbd7bd41bbf39d1fd5736997122a4652c78ddc50 (diff)
Rework hashing, use a more extensible framework similar to n3876 proposal
std::hash specialization is a pain to work with, stop using that, and just specialize a 'size_t hash_value(const T&)' free function.
Diffstat (limited to 'src/unordered_map.hh')
-rw-r--r--src/unordered_map.hh17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/unordered_map.hh b/src/unordered_map.hh
new file mode 100644
index 00000000..a3074ad6
--- /dev/null
+++ b/src/unordered_map.hh
@@ -0,0 +1,17 @@
+#ifndef unordered_map_hh_INCLUDED
+#define unordered_map_hh_INCLUDED
+
+#include "hash.hh"
+
+#include <unordered_map>
+
+namespace Kakoune
+{
+
+template<typename Key, typename Value>
+using UnorderedMap = std::unordered_map<Key, Value, Hash<Key>>;
+
+}
+
+#endif // unordered_map_hh_INCLUDED
+