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>2021-03-17 18:38:49 +0300
committerJacques Lucke <jacques@blender.org>2021-03-17 18:38:49 +0300
commite9eb08fea16ab033bec52e9b7355f6b52245e152 (patch)
tree883911deff8960307ec6a4c10a7cf83633ac9bbc /source/blender/blenlib/BLI_vector.hh
parentbf620020f135eab149b6327b79de8b378d99be7e (diff)
BLI: support equality operator on Span and Vector
This is quite convenient sometimes and is available for `std::vector` as well.
Diffstat (limited to 'source/blender/blenlib/BLI_vector.hh')
-rw-r--r--source/blender/blenlib/BLI_vector.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_vector.hh b/source/blender/blenlib/BLI_vector.hh
index fe6d54ae9e5..eefacd5d64f 100644
--- a/source/blender/blenlib/BLI_vector.hh
+++ b/source/blender/blenlib/BLI_vector.hh
@@ -879,6 +879,16 @@ class Vector {
return IndexRange(this->size());
}
+ friend bool operator==(const Vector &a, const Vector &b)
+ {
+ return a.as_span() == b.as_span();
+ }
+
+ friend bool operator!=(const Vector &a, const Vector &b)
+ {
+ return !(a == b);
+ }
+
/**
* Print some debug information about the vector.
*/