diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-08 15:40:34 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-08 16:10:30 +0300 |
commit | a8ff8b64dc4d4bea9ec620920639440496dfcba0 (patch) | |
tree | c916476052252d831f7f4a562e87d5bc00922048 /source/blender/blenlib/BLI_hash.hh | |
parent | ff444da7c45403ac0d112042c9d1d0a1992168d4 (diff) |
BLI: add comparison operators and hash functions for float3, etc.
Diffstat (limited to 'source/blender/blenlib/BLI_hash.hh')
-rw-r--r-- | source/blender/blenlib/BLI_hash.hh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_hash.hh b/source/blender/blenlib/BLI_hash.hh index 49e619ff1bc..5cd4ce3c1a9 100644 --- a/source/blender/blenlib/BLI_hash.hh +++ b/source/blender/blenlib/BLI_hash.hh @@ -154,6 +154,13 @@ template<> struct DefaultHash<float> { } }; +template<> struct DefaultHash<bool> { + uint32_t operator()(bool value) const + { + return (uint32_t)(value != false) * 1298191; + } +}; + inline uint32_t hash_string(StringRef str) { uint32_t hash = 5381; |