mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
Fix ArrayMem & operator= (ArrayMem && a2)
This commit is contained in:
parent
39e4e2bc12
commit
372b0a3089
@ -1112,19 +1112,15 @@ namespace ngcore
|
||||
|
||||
ArrayMem & operator= (ArrayMem && a2)
|
||||
{
|
||||
if (a2.mem_to_delete)
|
||||
{
|
||||
ngcore::Swap (mem_to_delete, a2.mem_to_delete);
|
||||
ngcore::Swap (data, a2.data);
|
||||
ngcore::Swap (allocsize, a2.allocsize);
|
||||
ngcore::Swap (size, a2.size);
|
||||
}
|
||||
else
|
||||
{
|
||||
allocsize = S;
|
||||
for (size_t i = 0; i < S; i++)
|
||||
mem[i] = std::move(a2.mem[i]);
|
||||
}
|
||||
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]);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user