Changeset View
Changeset View
Standalone View
Standalone View
source/blender/functions/FN_spans.hh
| Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | public: | ||||
| void *data() | void *data() | ||||
| { | { | ||||
| return data_; | return data_; | ||||
| } | } | ||||
| void *operator[](int64_t index) | void *operator[](int64_t index) | ||||
| { | { | ||||
| BLI_assert(index >= 0); | |||||
| BLI_assert(index < size_); | |||||
| return POINTER_OFFSET(data_, type_->size() * index); | |||||
| } | |||||
| void *operator[](int64_t index) const | |||||
| { | |||||
| BLI_assert(index >= 0); | |||||
| BLI_assert(index < size_); | BLI_assert(index < size_); | ||||
| return POINTER_OFFSET(data_, type_->size() * index); | return POINTER_OFFSET(data_, type_->size() * index); | ||||
| } | } | ||||
| template<typename T> MutableSpan<T> typed() | template<typename T> MutableSpan<T> typed() | ||||
| { | { | ||||
| BLI_assert(type_->is<T>()); | BLI_assert(type_->is<T>()); | ||||
| return MutableSpan<T>(static_cast<T *>(data_), size_); | return MutableSpan<T>(static_cast<T *>(data_), size_); | ||||
| ▲ Show 20 Lines • Show All 283 Lines • Show Last 20 Lines | |||||