|
|
@@ -5,6 +5,7 @@
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
+#include "murmur.h"
|
|
|
#include "types.h"
|
|
|
|
|
|
namespace crown
|
|
|
@@ -148,4 +149,22 @@ struct hash<u64>
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+template<>
|
|
|
+struct hash<f32>
|
|
|
+{
|
|
|
+ u32 operator()(const f32 val) const
|
|
|
+ {
|
|
|
+ return val == 0.0f ? 0 : murmur32(&val, sizeof(val), 0);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+template<>
|
|
|
+struct hash<f64>
|
|
|
+{
|
|
|
+ u32 operator()(const f64 val) const
|
|
|
+ {
|
|
|
+ return val == 0.0 ? 0 : murmur32(&val, sizeof(val), 0);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
} // namespace crown
|