diff --git a/source/blender/blenlib/BLI_index_range.hh b/source/blender/blenlib/BLI_index_range.hh index 7f1266c6716..7991f68c5bc 100644 --- a/source/blender/blenlib/BLI_index_range.hh +++ b/source/blender/blenlib/BLI_index_range.hh @@ -105,6 +105,11 @@ class IndexRange { return a.current_ == b.current_; } + constexpr friend int64_t operator-(const Iterator &a, const Iterator &b) + { + return a.current_ - b.current_; + } + constexpr int64_t operator*() const { return current_; @@ -151,6 +156,11 @@ class IndexRange { return size_; } + constexpr IndexRange index_range() const + { + return IndexRange(size_); + } + /** * Returns true if the size is zero. */