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:
Diffstat (limited to 'source/blender/blenlib/BLI_vector.hh')
-rw-r--r--source/blender/blenlib/BLI_vector.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_vector.hh b/source/blender/blenlib/BLI_vector.hh
index da9ab9c313e..acf47f67168 100644
--- a/source/blender/blenlib/BLI_vector.hh
+++ b/source/blender/blenlib/BLI_vector.hh
@@ -387,6 +387,16 @@ class Vector {
}
/**
+ * Reset the size of the vector so that it contains new_size elements.
+ * All existing elements are destructed, and not copied if the data must be reallocated.
+ */
+ void reinitialize(const int64_t new_size)
+ {
+ this->clear();
+ this->resize(new_size);
+ }
+
+ /**
* Afterwards the vector has 0 elements, but will still have
* memory to be refilled again.
*/