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-20 14:02:10 +0300
committerJacques Lucke <jacques@blender.org>2020-07-20 14:02:10 +0300
commit579b1800534fa08950278169c45db4b3be09b42c (patch)
tree4bcce8c9a3c43ca2b7bc5826862470df36ad1651 /source/blender/blenlib/BLI_array.hh
parent8cbbdedaf4dfec9e320e7e2be58b75d256950df1 (diff)
BLI: add Vector/Array.fill methods
Diffstat (limited to 'source/blender/blenlib/BLI_array.hh')
-rw-r--r--source/blender/blenlib/BLI_array.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_array.hh b/source/blender/blenlib/BLI_array.hh
index c30893f1337..871038d7d85 100644
--- a/source/blender/blenlib/BLI_array.hh
+++ b/source/blender/blenlib/BLI_array.hh
@@ -269,6 +269,14 @@ class Array {
}
/**
+ * Copies the given value to every element in the array.
+ */
+ void fill(const T &value) const
+ {
+ initialized_fill_n(data_, size_, value);
+ }
+
+ /**
* Get a pointer to the beginning of the array.
*/
const T *data() const