diff options
Diffstat (limited to 'source/blender/blenlib/BLI_array.hh')
-rw-r--r-- | source/blender/blenlib/BLI_array.hh | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/blenlib/BLI_array.hh b/source/blender/blenlib/BLI_array.hh index 8569d3d1af8..ee4e9702779 100644 --- a/source/blender/blenlib/BLI_array.hh +++ b/source/blender/blenlib/BLI_array.hh @@ -201,6 +201,18 @@ class Array { return *this; } + T &operator[](uint index) + { + BLI_assert(index < size_); + return data_[index]; + } + + const T &operator[](uint index) const + { + BLI_assert(index < size_); + return data_[index]; + } + operator Span<T>() const { return Span<T>(data_, size_); @@ -221,18 +233,6 @@ class Array { return *this; } - T &operator[](uint index) - { - BLI_assert(index < size_); - return data_[index]; - } - - const T &operator[](uint index) const - { - BLI_assert(index < size_); - return data_[index]; - } - /** * Returns the number of elements in the array. */ |