diff options
author | Jacques Lucke <mail@jlucke.com> | 2020-02-10 15:54:57 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2020-02-10 16:09:01 +0300 |
commit | 68cc982dcb7c1063a96f7ec9b7ccb95da4919d6b (patch) | |
tree | 9d2076363b54cb6b6da96064453ac3499a5f65c8 /source/blender/blenlib/intern/BLI_index_range.cc | |
parent | 76208a5670bc9d70f99f22a3c49463959461b5c1 (diff) |
BLI: improve various C++ data structures
The changes come from the `functions` branch, where I'm using
these structures a lot.
This also includes a new `BLI::Optional<T>` type, which is similar
to `std::Optional<T>` which can be used when Blender starts using
C++17.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_index_range.cc')
-rw-r--r-- | source/blender/blenlib/intern/BLI_index_range.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/BLI_index_range.cc b/source/blender/blenlib/intern/BLI_index_range.cc index fde4dcf6d41..6421eb0794b 100644 --- a/source/blender/blenlib/intern/BLI_index_range.cc +++ b/source/blender/blenlib/intern/BLI_index_range.cc @@ -24,7 +24,7 @@ namespace BLI { -static Vector<Array<uint, RawAllocator>, 1, RawAllocator> arrays; +static Vector<Array<uint, 0, RawAllocator>, 1, RawAllocator> arrays; static uint current_array_size = 0; static uint *current_array = nullptr; static std::mutex current_array_mutex; @@ -44,7 +44,7 @@ ArrayRef<uint> IndexRange::as_array_ref() const } uint new_size = std::max<uint>(1000, power_of_2_max_u(min_required_size)); - Array<uint, RawAllocator> new_array(new_size); + Array<uint, 0, RawAllocator> new_array(new_size); for (uint i = 0; i < new_size; i++) { new_array[i] = i; } |