hashing: Add hasher for unordered_map

This commit is contained in:
Tomasz Grabiec
2024-11-08 08:14:37 +01:00
parent 8209b301a3
commit 5dbbbf6300

View File

@@ -165,6 +165,16 @@ struct appending_hash<std::map<K, V>> {
}
};
template<typename K, typename V>
struct appending_hash<std::unordered_map<K, V>> {
template<typename H>
requires Hasher<H>
void operator()(H& h, const std::unordered_map<K, V>& value) const noexcept {
std::map<K, V> sorted(value.begin(), value.end());
feed_hash(h, sorted);
}
};
template<>
struct appending_hash<sstring> {
template<typename H>