Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-07-03 15:31:26 +0300
committerJacques Lucke <jacques@blender.org>2020-07-03 15:31:26 +0300
commit7704e6a678ab324b479797dc8d8f8d63b109956f (patch)
treea1ac8c05610c15aa6642b8f69b8c517533d7009b /source/blender/blenlib/BLI_array.hh
parent395b294b614f43faac0ffaef167aed1b94a53b8e (diff)
Cleanup: bring operator overloads closer together
Diffstat (limited to 'source/blender/blenlib/BLI_array.hh')
-rw-r--r--source/blender/blenlib/BLI_array.hh24
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.
*/