From e9eb08fea16ab033bec52e9b7355f6b52245e152 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Wed, 17 Mar 2021 16:38:49 +0100 Subject: BLI: support equality operator on Span and Vector This is quite convenient sometimes and is available for `std::vector` as well. --- source/blender/blenlib/BLI_vector.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/blender/blenlib/BLI_vector.hh') 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. */ -- cgit v1.2.3