diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-20 14:02:10 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-20 14:02:10 +0300 |
commit | 579b1800534fa08950278169c45db4b3be09b42c (patch) | |
tree | 4bcce8c9a3c43ca2b7bc5826862470df36ad1651 /source/blender/blenlib/BLI_vector.hh | |
parent | 8cbbdedaf4dfec9e320e7e2be58b75d256950df1 (diff) |
BLI: add Vector/Array.fill methods
Diffstat (limited to 'source/blender/blenlib/BLI_vector.hh')
-rw-r--r-- | source/blender/blenlib/BLI_vector.hh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_vector.hh b/source/blender/blenlib/BLI_vector.hh index 66de8d2fbd1..11bb00c3f8d 100644 --- a/source/blender/blenlib/BLI_vector.hh +++ b/source/blender/blenlib/BLI_vector.hh @@ -703,6 +703,14 @@ class Vector { } /** + * Copies the given value to every element in the vector. + */ + void fill(const T &value) const + { + initialized_fill_n(begin_, this->size(), value); + } + + /** * Get access to the underlying array. */ T *data() |