From 7704e6a678ab324b479797dc8d8f8d63b109956f Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 3 Jul 2020 14:31:26 +0200 Subject: Cleanup: bring operator overloads closer together --- source/blender/blenlib/BLI_array.hh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender/blenlib/BLI_array.hh') 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() const { return Span(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. */ -- cgit v1.2.3