diff --git a/common/hashlib.h b/common/hashlib.h index 063df78f..b71f0129 100644 --- a/common/hashlib.h +++ b/common/hashlib.h @@ -13,6 +13,7 @@ #define HASHLIB_H #include +#include #include #include #include @@ -132,6 +133,18 @@ template struct hash_ops> } }; +template struct hash_ops> +{ + static inline bool cmp(std::array a, std::array b) { return a == b; } + static inline unsigned int hash(std::array a) + { + unsigned int h = mkhash_init; + for (auto k : a) + h = mkhash(h, hash_ops::hash(k)); + return h; + } +}; + struct hash_cstr_ops { static inline bool cmp(const char *a, const char *b)