mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
Fix ArrayMem::operator=(ArrayMem&&) (again)
This commit is contained in:
parent
1653f56efc
commit
da85de4795
@ -1115,11 +1115,15 @@ namespace ngcore
|
|||||||
ngcore::Swap (mem_to_delete, a2.mem_to_delete);
|
ngcore::Swap (mem_to_delete, a2.mem_to_delete);
|
||||||
ngcore::Swap (allocsize, a2.allocsize);
|
ngcore::Swap (allocsize, a2.allocsize);
|
||||||
ngcore::Swap (size, a2.size);
|
ngcore::Swap (size, a2.size);
|
||||||
ngcore::Swap (data, a2.data);
|
|
||||||
|
|
||||||
if (mem_to_delete==nullptr)
|
if (mem_to_delete==nullptr)
|
||||||
|
{
|
||||||
for (auto i : Range(size))
|
for (auto i : Range(size))
|
||||||
mem[i] = std::move(a2.mem[i]);
|
mem[i] = std::move(a2.mem[i]);
|
||||||
|
data = mem;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ngcore::Swap (data, a2.data);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user