diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-03 15:31:26 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-03 15:31:26 +0300 |
commit | 7704e6a678ab324b479797dc8d8f8d63b109956f (patch) | |
tree | a1ac8c05610c15aa6642b8f69b8c517533d7009b /source/blender/blenlib/BLI_array.hh | |
parent | 395b294b614f43faac0ffaef167aed1b94a53b8e (diff) |
Cleanup: bring operator overloads closer together
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. */ |