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_float2.hh | |
parent | ff444da7c45403ac0d112042c9d1d0a1992168d4 (diff) |
BLI: add comparison operators and hash functions for float3, etc.
Diffstat (limited to 'source/blender/blenlib/BLI_float2.hh')
-rw-r--r-- | source/blender/blenlib/BLI_float2.hh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_float2.hh b/source/blender/blenlib/BLI_float2.hh index 94da5d18ad2..7bf928e7db5 100644 --- a/source/blender/blenlib/BLI_float2.hh +++ b/source/blender/blenlib/BLI_float2.hh @@ -79,6 +79,16 @@ struct float2 { stream << "(" << v.x << ", " << v.y << ")"; return stream; } + + friend bool operator==(const float2 &a, const float2 &b) + { + return a.x == b.x && a.y == b.y; + } + + friend bool operator!=(const float2 &a, const float2 &b) + { + return !(a == b); + } }; } // namespace blender |