1
0
mirror of synced 2026-04-27 12:40:28 +00:00

hashlib: Add a hash for bool.

This commit is contained in:
Marcelina Kościelnicka
2021-05-24 21:27:29 +02:00
parent 5488c69d2a
commit dbfd0b61e3

View File

@@ -66,6 +66,12 @@ struct hash_int_ops {
}
};
template<> struct hash_ops<bool> : hash_int_ops
{
static inline unsigned int hash(bool a) {
return a ? 1 : 0;
}
};
template<> struct hash_ops<int32_t> : hash_int_ops
{
static inline unsigned int hash(int32_t a) {