From f2a5f51e8c3866638d71be7c1f336448d08d980a Mon Sep 17 00:00:00 2001 From: Christian Mattes <christian.mattes@rwth-aachen.de> Date: Tue, 11 Dec 2018 11:29:20 +0100 Subject: [PATCH] Fixed primitive_attribute::operator= --- src/polymesh/impl/impl_attributes.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/polymesh/impl/impl_attributes.hh b/src/polymesh/impl/impl_attributes.hh index 1bcb812..e917d3a 100644 --- a/src/polymesh/impl/impl_attributes.hh +++ b/src/polymesh/impl/impl_attributes.hh @@ -139,11 +139,12 @@ primitive_attribute<tag, AttrT> &primitive_attribute<tag, AttrT>::operator=(prim { this->deregister_attr(); - if (this->capacity() < rhs.capacity()) - this->resize(rhs.capacity()); + auto old_size = this->size(); this->mMesh = rhs.mMesh; this->mDefaultValue = rhs.mDefaultValue; + + this->resizeFrom(old_size); this->copy_from(rhs); this->register_attr(); -- GitLab