Merge branch 'fix_array_mem' into 'master'

Fix ArrayMem::operator=(ArrayMem&&) (again)

See merge request jschoeberl/netgen!176
This commit is contained in:
Joachim Schöberl 2019-07-12 06:57:58 +00:00
commit 56915fc89a

View File

@ -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;
}