From 79e1165bd7488850e896112c2b0f8bf1e6b25db9 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sat, 14 Sep 2019 12:11:14 +0200 Subject: BLI: Improve forwarding semantics of some data structures This makes it possible to use e.g. `std::unique_ptr` in a map. --- source/blender/blenlib/BLI_vector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib/BLI_vector.h') diff --git a/source/blender/blenlib/BLI_vector.h b/source/blender/blenlib/BLI_vector.h index 97357ecd384..c9701dcaa52 100644 --- a/source/blender/blenlib/BLI_vector.h +++ b/source/blender/blenlib/BLI_vector.h @@ -419,7 +419,7 @@ template class Ve { BLI_assert(!this->empty()); m_end--; - T value = *m_end; + T value = std::move(*m_end); destruct(m_end); UPDATE_VECTOR_SIZE(this); return value; @@ -435,7 +435,7 @@ template class Ve T *element_to_remove = m_begin + index; m_end--; if (element_to_remove < m_end) { - *element_to_remove = *m_end; + *element_to_remove = std::move(*m_end); } destruct(m_end); UPDATE_VECTOR_SIZE(this); -- cgit v1.2.3