From cf1771926d9639cd387a0e0feb9361e49febfed4 Mon Sep 17 00:00:00 2001 From: Noel Berry Date: Sat, 24 Apr 2021 22:47:44 -0700 Subject: [PATCH] fixed StackVector copy/move assignment operators --- include/blah/containers/stackvector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/blah/containers/stackvector.h b/include/blah/containers/stackvector.h index 84e6d60..1982e33 100644 --- a/include/blah/containers/stackvector.h +++ b/include/blah/containers/stackvector.h @@ -98,7 +98,7 @@ namespace Blah clear(); for (int i = 0; i < src.m_count; i++) - data()[i] = src.data()[i]; + new (data() + i) T(std::move(src.data()[i])); m_count = src.m_count; return *this; @@ -110,7 +110,7 @@ namespace Blah clear(); for (int i = 0; i < src.m_count; i++) - data()[i] = std::move(src.data()[i]); + new (data() + i) T(std::move(src.data()[i])); m_count = src.m_count; return *this;