[Bf-blender-cvs] [0b2164c5ed9] functions: remove unused MappedArrayRef class

Jacques Lucke noreply at git.blender.org
Tue Aug 20 18:32:54 CEST 2019


Commit: 0b2164c5ed9e13de0bfa8c83759bc598a8a2de5a
Author: Jacques Lucke
Date:   Tue Aug 20 18:12:20 2019 +0200
Branches: functions
https://developer.blender.org/rB0b2164c5ed9e13de0bfa8c83759bc598a8a2de5a

remove unused MappedArrayRef class

===================================================================

M	source/blender/blenlib/BLI_array_ref.hpp

===================================================================

diff --git a/source/blender/blenlib/BLI_array_ref.hpp b/source/blender/blenlib/BLI_array_ref.hpp
index eb49c155c97..5ac73ca124b 100644
--- a/source/blender/blenlib/BLI_array_ref.hpp
+++ b/source/blender/blenlib/BLI_array_ref.hpp
@@ -291,66 +291,4 @@ template<typename T> ArrayRef<T> ref_c_array(T *array, uint size)
   return ArrayRef<T>(array, size);
 }
 
-template<typename ArrayT, typename ValueT, ValueT (*GetValue)(ArrayT &item)> class MappedArrayRef {
- private:
-  ArrayT *m_start = nullptr;
-  uint m_size = 0;
-
- public:
-  MappedArrayRef() = default;
-
-  MappedArrayRef(ArrayT *start, uint size) : m_start(start), m_size(size)
-  {
-  }
-
-  uint size() const
-  {
-    return m_size;
-  }
-
-  ValueT operator[](uint index)
-  {
-    BLI_assert(index < m_size);
-    return GetValue(m_start[index]);
-  }
-
-  class It {
-   private:
-    MappedArrayRef m_array_ref;
-    uint m_index;
-
-   public:
-    It(MappedArrayRef array_ref, uint index) : m_array_ref(array_ref), m_index(index)
-    {
-    }
-
-    It &operator++()
-    {
-      m_index++;
-      return *this;
-    }
-
-    bool operator!=(const It &other) const
-    {
-      BLI_assert(m_array_ref.m_start == other.m_array_ref.m_start);
-      return m_index != other.m_index;
-    }
-
-    ValueT operator*() const
-    {
-      return GetValue(m_array_ref.m_start[m_index]);
-    }
-  };
-
-  It begin() const
-  {
-    return It(*this, 0);
-  }
-
-  It end() const
-  {
-    return It(*this, m_size);
-  }
-};
-
 } /* namespace BLI */



More information about the Bf-blender-cvs mailing list