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:
Diffstat (limited to 'source/blender/blenlib/BLI_span.hh')
-rw-r--r--source/blender/blenlib/BLI_span.hh13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_span.hh b/source/blender/blenlib/BLI_span.hh
index f4960df8ab9..fcc6d6f754b 100644
--- a/source/blender/blenlib/BLI_span.hh
+++ b/source/blender/blenlib/BLI_span.hh
@@ -417,6 +417,19 @@ template<typename T> class Span {
return Span<NewT>(reinterpret_cast<const NewT *>(data_), new_size);
}
+ friend bool operator==(const Span<T> a, const Span<T> b)
+ {
+ if (a.size() != b.size()) {
+ return false;
+ }
+ return std::equal(a.begin(), a.end(), b.begin());
+ }
+
+ friend bool operator!=(const Span<T> a, const Span<T> b)
+ {
+ return !(a == b);
+ }
+
/**
* A debug utility to print the content of the Span. Every element will be printed on a
* separate line using the given callback.