diff --git a/libsrc/core/array.hpp b/libsrc/core/array.hpp index 211a5c04..253a476c 100644 --- a/libsrc/core/array.hpp +++ b/libsrc/core/array.hpp @@ -1115,11 +1115,15 @@ namespace ngcore ngcore::Swap (mem_to_delete, a2.mem_to_delete); ngcore::Swap (allocsize, a2.allocsize); ngcore::Swap (size, a2.size); - ngcore::Swap (data, a2.data); if (mem_to_delete==nullptr) + { for (auto i : Range(size)) mem[i] = std::move(a2.mem[i]); + data = mem; + } + else + ngcore::Swap (data, a2.data); return *this; }