Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-07-08 15:40:34 +0300
committerJacques Lucke <jacques@blender.org>2020-07-08 16:10:30 +0300
commita8ff8b64dc4d4bea9ec620920639440496dfcba0 (patch)
treec916476052252d831f7f4a562e87d5bc00922048 /source/blender/blenlib/BLI_float2.hh
parentff444da7c45403ac0d112042c9d1d0a1992168d4 (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.hh10
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