diff options
author | Jacques Lucke <jacques@blender.org> | 2020-06-09 12:58:47 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-06-09 12:58:47 +0300 |
commit | f7c0f1b8b83ac475755b633abf59cf9f447b2d49 (patch) | |
tree | 97302f741ce4e40f6e4de9f0cfd54c7320ee7fd5 /source/blender/blenlib/BLI_index_mask.hh | |
parent | 7d2b4ae9c6ecce394130cd08694914bf93497a11 (diff) |
BLI: rename ArrayRef to Span
This also renames `MutableArrayRef` to `MutableSpan`.
The name "Span" works better, because `std::span` will provide
similar functionality in C++20. Furthermore, a shorter, more
concise name for a common data structure is nice.
Diffstat (limited to 'source/blender/blenlib/BLI_index_mask.hh')
-rw-r--r-- | source/blender/blenlib/BLI_index_mask.hh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenlib/BLI_index_mask.hh b/source/blender/blenlib/BLI_index_mask.hh index 4cd348215fe..cc1bf05f936 100644 --- a/source/blender/blenlib/BLI_index_mask.hh +++ b/source/blender/blenlib/BLI_index_mask.hh @@ -38,15 +38,15 @@ * same time. */ -#include "BLI_array_ref.hh" #include "BLI_index_range.hh" +#include "BLI_span.hh" namespace blender { class IndexMask { private: /* The underlying reference to sorted integers. */ - ArrayRef<uint> m_indices; + Span<uint> m_indices; public: /* Creates an IndexMask that contains no indices. */ @@ -57,7 +57,7 @@ class IndexMask { * This constructor asserts that the given integers are in ascending order and that there are no * duplicates. */ - IndexMask(ArrayRef<uint> indices) : m_indices(indices) + IndexMask(Span<uint> indices) : m_indices(indices) { #ifdef DEBUG for (uint i = 1; i < indices.size(); i++) { @@ -70,7 +70,7 @@ class IndexMask { * Use this method when you know that no indices are skipped. It is more efficient than preparing * an integer array all the time. */ - IndexMask(IndexRange range) : m_indices(range.as_array_ref()) + IndexMask(IndexRange range) : m_indices(range.as_span()) { } @@ -84,7 +84,7 @@ class IndexMask { * Do this: * do_something_with_an_index_mask({3, 4, 5}); */ - IndexMask(const std::initializer_list<uint> &indices) : IndexMask(ArrayRef<uint>(indices)) + IndexMask(const std::initializer_list<uint> &indices) : IndexMask(Span<uint>(indices)) { } @@ -95,7 +95,7 @@ class IndexMask { { } - operator ArrayRef<uint>() const + operator Span<uint>() const { return m_indices; } @@ -133,7 +133,7 @@ class IndexMask { } } - ArrayRef<uint> indices() const + Span<uint> indices() const { return m_indices; } |