Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2019-09-14 13:11:14 +0300
committerJacques Lucke <mail@jlucke.com>2019-09-14 13:11:14 +0300
commit79e1165bd7488850e896112c2b0f8bf1e6b25db9 (patch)
tree1cb20163e2aaff754e295360457b1f15428eca25 /source/blender/blenlib/BLI_vector.h
parentca76ecfa0ee1153677d8c89149000c7e9a5814d6 (diff)
BLI: Improve forwarding semantics of some data structures
This makes it possible to use e.g. `std::unique_ptr` in a map.
Diffstat (limited to 'source/blender/blenlib/BLI_vector.h')
-rw-r--r--source/blender/blenlib/BLI_vector.h4
1 files changed, 2 insertions, 2 deletions
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<typename T, uint N = 4, typename Allocator = GuardedAllocator> 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<typename T, uint N = 4, typename Allocator = GuardedAllocator> 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);