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_vector_set.hh | 50 ++++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'source/blender/blenlib/BLI_vector_set.hh') diff --git a/source/blender/blenlib/BLI_vector_set.hh b/source/blender/blenlib/BLI_vector_set.hh index 6d7fd101b65..2ee1113e221 100644 --- a/source/blender/blenlib/BLI_vector_set.hh +++ b/source/blender/blenlib/BLI_vector_set.hh @@ -235,6 +235,31 @@ class VectorSet { return *this; } + /** + * Get the key stored at the given position in the vector. + */ + const Key &operator[](uint32_t index) const + { + BLI_assert(index <= this->size()); + return keys_[index]; + } + + operator Span() const + { + return Span(keys_, this->size()); + } + + /** + * Get an Span referencing the keys vector. The referenced memory buffer is only valid as + * long as the vector set is not changed. + * + * The keys must not be changed, because this would change their hash value. + */ + Span as_span() const + { + return *this; + } + /** * Add a new key to the vector set. This invokes undefined behavior when the key is in the set * already. When you know for certain that a key is not in the set yet, use this method for @@ -402,31 +427,6 @@ class VectorSet { return keys_ + this->size(); } - /** - * Get the key stored at the given position in the vector. - */ - const Key &operator[](uint32_t index) const - { - BLI_assert(index <= this->size()); - return keys_[index]; - } - - operator Span() const - { - return Span(keys_, this->size()); - } - - /** - * Get an Span referencing the keys vector. The referenced memory buffer is only valid as - * long as the vector set is not changed. - * - * The keys must not be changed, because this would change their hash value. - */ - Span as_span() const - { - return *this; - } - /** * Print common statistics like size and collision count. This is useful for debugging purposes. */ -- cgit v1.2.3