Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_index_range.hh
| Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | public: | ||||
| { | { | ||||
| BLI_assert(n >= 0); | BLI_assert(n >= 0); | ||||
| BLI_assert(n < size_); | BLI_assert(n < size_); | ||||
| BLI_assert(this->size() > 0); | BLI_assert(this->size() > 0); | ||||
| return start_ + size_ - 1 - n; | return start_ + size_ - 1 - n; | ||||
| } | } | ||||
| /** | /** | ||||
| * Get the element one before the beginning. The returned value is undefined when the range is | |||||
| * empty, and the range must start after zero already. | |||||
| */ | |||||
| constexpr int64_t one_before_start() const | |||||
| { | |||||
| BLI_assert(start_ > 0); | |||||
| return start_ - 1; | |||||
JacquesLucke: That looks very wrong. | |||||
| } | |||||
| /** | |||||
| * Get the element one after the end. The returned value is undefined when the range is empty. | * Get the element one after the end. The returned value is undefined when the range is empty. | ||||
| */ | */ | ||||
| constexpr int64_t one_after_last() const | constexpr int64_t one_after_last() const | ||||
| { | { | ||||
| return start_ + size_; | return start_ + size_; | ||||
| } | } | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines | |||||
That looks very wrong.