48template<
typename T>
class Span;
134 return start_ + index;
142 return (a.size_ ==
b.size_) && (a.start_ ==
b.start_ || a.size_ == 0);
215 return start_ + size_ - 1 - n;
233 return start_ + size_;
249 return value >= start_ && value < start_ + size_;
257 if (range.is_empty()) {
260 if (range.start_ < start_) {
263 if (range.start_ + range.size_ > start_ + size_) {
277 BLI_assert(new_start + size <= start_ + size_ || size == 0);
282 return this->
slice(range.
start(), range.size());
292 const int64_t old_end = start_ + size_;
293 const int64_t new_start = std::min(old_end, std::max(start_, other.start_));
294 const int64_t new_end = std::max(new_start, std::min(old_end, other.start_ + other.size_));
295 return IndexRange(new_start, new_end - new_start);
305 const int64_t new_size = std::max<int64_t>(0, size_ - n);
316 const int64_t new_size = std::max<int64_t>(0, size_ - n);
327 const int64_t new_size = std::min<int64_t>(size_, n);
338 const int64_t new_size = std::min<int64_t>(size_, n);
339 return IndexRange(start_ + size_ - new_size, new_size);
constexpr Iterator(int64_t current)
const int64_t & iter_prop() const
constexpr int64_t operator*() const
constexpr int64_t one_before_start() const
constexpr int64_t first() const
constexpr friend bool operator!=(IndexRange a, IndexRange b)
constexpr int64_t one_after_last() const
constexpr IndexRange slice(IndexRange range) const
constexpr friend bool operator==(IndexRange a, IndexRange b)
constexpr int64_t operator[](int64_t index) const
constexpr IndexRange shift(int64_t n) const
constexpr Iterator end() const
constexpr IndexRange intersect(IndexRange other) const
constexpr IndexRange drop_back(int64_t n) const
constexpr IndexRange(const int64_t start, const int64_t size)
static constexpr IndexRange from_end_size(const int64_t end, const int64_t size)
constexpr int64_t last(const int64_t n=0) const
constexpr int64_t size() const
constexpr bool is_empty() const
static constexpr IndexRange from_begin_end(const int64_t begin, const int64_t end)
constexpr IndexRange with_new_end(const int64_t new_end) const
constexpr IndexRange()=default
static constexpr IndexRange from_begin_size(const int64_t begin, const int64_t size)
constexpr IndexRange after(int64_t n) const
constexpr int64_t start() const
constexpr bool contains(const IndexRange range) const
constexpr IndexRange before(int64_t n) const
constexpr IndexRange take_back(int64_t n) const
friend std::ostream & operator<<(std::ostream &stream, IndexRange range)
constexpr Iterator begin() const
static constexpr IndexRange from_single(const int64_t index)
constexpr IndexRange(int64_t size)
constexpr IndexRange slice(int64_t start, int64_t size) const
constexpr bool contains(int64_t value) const
constexpr IndexRange index_range() const
constexpr IndexRange take_front(int64_t n) const
static constexpr IndexRange from_begin_end_inclusive(const int64_t begin, const int64_t last)
constexpr IndexRange drop_front(int64_t n) const
local_group_size(16, 16) .push_constant(Type b
AlignedIndexRanges split_index_range_by_alignment(const IndexRange range, const int64_t alignment)